summaryrefslogtreecommitdiffstats
path: root/cfg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-05-17 21:21:31 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-05-17 21:21:31 +0000
commitac7e2f13e999c1f24b58f7db868c7faeeb0a3c0e (patch)
tree1ba37fb761a1b58f90b5214534fb90451c521361 /cfg.c
parent50cefec497946f7e19213470880bb5fbe2b8d7f1 (diff)
Ignore line continuation when escaped as \\, from Simon Nicolussi.
Diffstat (limited to 'cfg.c')
-rw-r--r--cfg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cfg.c b/cfg.c
index d49bfa61..22a50d22 100644
--- a/cfg.c
+++ b/cfg.c
@@ -109,7 +109,9 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
len = strlen(line);
if (len > 0 && line[len - 1] == '\\') {
line[len - 1] = '\0';
- continue;
+ /* Ignore escaped backslash at EOL. */
+ if (len > 1 && line[len - 2] != '\\')
+ continue;
}
buf = line;
line = NULL;