[coreboot] [PATCH] Fixes the build error while generating option_table.h
Paul Menzel
paulepanter at users.sourceforge.net
Mon May 9 18:29:30 CEST 2011
Am Montag, den 09.05.2011, 19:20 +0530 schrieb Vikram Narayanan:
> > Am 08.05.2011 20:01, schrieb Peter Stuge:
> >> if(!strncmp(line[strspn(line," ")],"\r\n",2) continue;
> > More like:
> > char val=line[strspn(line," ")];
> > if (val=='#' || val=='\n' || val=='\r') continue;
> >
> > This has the benefit of handling
> > " # comment"
> > and mac-style newlines, too.
> Thanks for all your comments.
> As Patrick suggested, here is the new patch.
A short commit message would have been nice.
> Signed-off by: Vikram Narayanan <vikram186 at gmail.com>
> Signed-off by: Patrick Georgi <patrick at georgi-clan.de>
> ---
> --- C:/coreboot/util/options/build_opt_tbl.c.orig Sun May 8 22:18:54 2011
> +++ C:/coreboot/util/options/build_opt_tbl.c Mon May 9 19:09:32 2011
> @@ -276,6 +276,7 @@
> int enum_length;
> int len;
> char buf[16];
> + char val;
>
> for(i=1;i<argc;i++) {
> if(argv[i][0]!='-') {
> @@ -371,8 +372,9 @@
> }
>
> /* skip commented and blank lines */
> - if(line[0]=='#') continue;
> - if(line[strspn(line," ")]=='\n') continue;
> + val = line[strspn(line," ")];
> + /* takes care of *nix,Mac and Windows line ending formats */
Whoever has commit rights and commits this, please add a space behind
the comma.
> + if (val=='#' || val=='\n' || val=='\r') continue;
> /* scan in the input data */
> sscanf(line,"%d %d %c %d %s",
> &ce->bit,&ce->length,&uc,&ce->config_id,&ce->name[0]);
Acked-by: Paul Menzel <paulepanter at users.sourceforge.net>
Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20110509/bc3dccaf/attachment.sig>
More information about the coreboot
mailing list