From: Matthew Wilcox Date: Thu, 13 Jul 2006 18:54:07 +0000 (-0600) Subject: kconfig: support DOS line endings X-Git-Tag: v2.6.19-rc1~1261^2~27 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d3660a8cbdfad620af88b85b7bbfff29160f14c2;p=linux-2.6-omap-h63xx.git kconfig: support DOS line endings Kconfig doesn't currently handle config files with DOS line endings. While these are, of course, an abomination, etc, etc, it can be handy to not have to convert them first. It's also a tiny patch and even adds support for lines ending in just \r or even \n\r. Signed-off-by: Matthew Wilcox Signed-off-by: Sam Ravnborg --- diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index a69d8acbf27..69f96b398c2 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -193,8 +193,11 @@ load: continue; *p++ = 0; p2 = strchr(p, '\n'); - if (p2) - *p2 = 0; + if (p2) { + *p2-- = 0; + if (*p2 == '\r') + *p2 = 0; + } if (def == S_DEF_USER) { sym = sym_find(line + 7); if (!sym) { @@ -266,6 +269,7 @@ load: ; } break; + case '\r': case '\n': break; default: