Author: oxygene
Date: Tue May 10 23:42:52 2011
New Revision: 6563
URL: https://tracker.coreboot.org/trac/coreboot/changeset/6563

Log:
Fix compilation error due to non-unix style line endings in cmos.layout file 
while generating option_table.h.

Windows, Mac and *nix type line endings are now taken care of.

Signed-off-by: Patrick Georgi <[email protected]>
Signed-off-by: Vikram Narayanan <[email protected]>
Acked-by: Paul Menzel <[email protected]>

Modified:
   trunk/util/options/build_opt_tbl.c

Modified: trunk/util/options/build_opt_tbl.c
==============================================================================
--- trunk/util/options/build_opt_tbl.c  Mon May  9 22:53:38 2011        (r6562)
+++ trunk/util/options/build_opt_tbl.c  Tue May 10 23:42:52 2011        (r6563)
@@ -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 */
+               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]);

-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to