aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2013-04-12 20:48:55 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2013-04-12 20:48:55 +0000
commit69e6d7b75e96c406d072cb83ffc9b26fbf1a86fb (patch)
tree54038c9ac32a45f8741dcc23fb9a8ffc0e15ff89 /usr.sbin/config
parent51048477bcc79bcc8753121ec91c150648df3d1b (diff)
parent8818042ff2ecd155adb5c248a22de2dbe5d9c2a9 (diff)
downloadsrc-69e6d7b75e96c406d072cb83ffc9b26fbf1a86fb.tar.gz
src-69e6d7b75e96c406d072cb83ffc9b26fbf1a86fb.zip
Notes
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 14061c2081c6..3ed5495cdd66 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -351,16 +351,24 @@ begin:
if (ch == '"' || ch == '\'') {
int quote = ch;
+ escaped_nl = 0;
while ((ch = getc(fp)) != EOF) {
- if (ch == quote)
+ if (ch == quote && !escaped_nl)
break;
- if (ch == '\n') {
+ if (ch == '\n' && !escaped_nl) {
*cp = 0;
printf("config: missing quote reading `%s'\n",
line);
exit(2);
}
+ if (ch == '\\' && !escaped_nl) {
+ escaped_nl = 1;
+ continue;
+ }
+ if (ch != quote && escaped_nl)
+ *cp++ = '\\';
*cp++ = ch;
+ escaped_nl = 0;
}
} else {
*cp++ = ch;