Skip to content

Commit

Permalink
kconfig: support DOS line endings
Browse files Browse the repository at this point in the history
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 <matthew@wil.cx>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Matthew Wilcox authored and Sam Ravnborg committed Sep 25, 2006
1 parent 4f5537d commit d3660a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,11 @@ int conf_read_simple(const char *name, int def)
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) {
Expand Down Expand Up @@ -266,6 +269,7 @@ int conf_read_simple(const char *name, int def)
;
}
break;
case '\r':
case '\n':
break;
default:
Expand Down

0 comments on commit d3660a8

Please sign in to comment.