summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2011-05-10 21:42:52 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2011-05-10 21:42:52 +0000
commita8f0f5120b69e02eff5337932b92771363d159a5 (patch)
treeb9d983db3963b052d1ebe5964dcdc9663a9d38e6
parentf2ed23f45b84d23afd8991d4c12dc1085d94e523 (diff)
downloadcoreboot-a8f0f5120b69e02eff5337932b92771363d159a5.tar.xz
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@georgi-clan.de> Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6563 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--util/options/build_opt_tbl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c
index cbba80dcb7..b89bb4f1d5 100644
--- a/util/options/build_opt_tbl.c
+++ b/util/options/build_opt_tbl.c
@@ -276,6 +276,7 @@ int main(int argc, char **argv)
int enum_length;
int len;
char buf[16];
+ char val;
for(i=1;i<argc;i++) {
if(argv[i][0]!='-') {
@@ -371,8 +372,9 @@ int main(int argc, char **argv)
}
/* 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]);