[coreboot] [commit] r6563 - trunk/util/options

repository service svn at coreboot.org
Tue May 10 23:42:52 CEST 2011


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 <patrick at georgi-clan.de>
Signed-off-by: Vikram Narayanan <vikram186 at gmail.com>
Acked-by: Paul Menzel <paulepanter at users.sourceforge.net>

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]);




More information about the coreboot mailing list