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 <[email protected]> > Signed-off by: Patrick Georgi <[email protected]> > --- > --- 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 <[email protected]> Thanks, Paul
signature.asc
Description: This is a digitally signed message part
-- coreboot mailing list: [email protected] http://www.coreboot.org/mailman/listinfo/coreboot

