summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 013f276)
raw | patch | inline | side by side (parent: 013f276)
author | Linus Torvalds <torvalds@osdl.org> | |
Tue, 11 Oct 2005 22:24:11 +0000 (15:24 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 11 Oct 2005 22:24:11 +0000 (15:24 -0700) |
I had meant to disallow unknown escape characters in the config file
parser, but instead an unknown escaped character would silently pass
through as itself. That's correct for some cases (notably '\' itself), but
wasn't correct in general.
This fixes it, and makes the parser write a nice error message if the
config file contains bogus escaped characters.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
parser, but instead an unknown escaped character would silently pass
through as itself. That's correct for some cases (notably '\' itself), but
wasn't correct in general.
This fixes it, and makes the parser write a nice error message if the
config file contains bogus escaped characters.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
config.c | patch | blob | history |
diff --git a/config.c b/config.c
index f3c4fa42ac759157373885924b91a4a43f59953c..510456ceb59d5608d13164fe976631b3ba874fd6 100644 (file)
--- a/config.c
+++ b/config.c
case 'n':
c = '\n';
break;
- return NULL;
+ /* Some characters escape as themselves */
+ case '\\': case '"':
+ break;
+ /* Reject unknown escape sequences */
+ default:
+ return NULL;
}
value[len++] = c;
continue;