diff options
author | Sunil Nimmagadda <sunil@cvs.openbsd.org> | 2015-10-26 16:38:07 +0000 |
---|---|---|
committer | Sunil Nimmagadda <sunil@cvs.openbsd.org> | 2015-10-26 16:38:07 +0000 |
commit | 8221e233064027330df923653dc6aa2a19782713 (patch) | |
tree | 4db5933e200698a560765b7517cc0a6fe3076ffa /usr.sbin/smtpd/makemap.c | |
parent | 17a200456dbcb6b279efef3e2be92bc24ebd0a77 (diff) |
Fix makemap(8) for values containing a '#'.
Ok millert@ gilles@
Diffstat (limited to 'usr.sbin/smtpd/makemap.c')
-rw-r--r-- | usr.sbin/smtpd/makemap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c index bc5020c7fe3..bd6e1acc8d1 100644 --- a/usr.sbin/smtpd/makemap.c +++ b/usr.sbin/smtpd/makemap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makemap.c,v 1.55 2015/10/17 19:44:07 gilles Exp $ */ +/* $OpenBSD: makemap.c,v 1.56 2015/10/26 16:38:06 sunil Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -232,7 +232,6 @@ parse_map(char *filename) char *line; size_t len; size_t lineno = 0; - char delim[] = { '\\', '\\', '#' }; if (strcmp(filename, "-") == 0) fp = fdopen(0, "r"); @@ -252,7 +251,8 @@ parse_map(char *filename) return 0; } - while ((line = fparseln(fp, &len, &lineno, delim, 0)) != NULL) { + while ((line = fparseln(fp, &len, &lineno, + NULL, FPARSELN_UNESCCOMM)) != NULL) { if (! parse_entry(line, len, lineno)) { free(line); fclose(fp); @@ -289,7 +289,7 @@ parse_mapentry(char *line, size_t len, size_t lineno) keyp = line; while (isspace((unsigned char)*keyp)) keyp++; - if (*keyp == '\0' || *keyp == '#') + if (*keyp == '\0') return 1; valp = keyp; @@ -298,7 +298,7 @@ parse_mapentry(char *line, size_t len, size_t lineno) goto bad; while (*valp == ':' || isspace((unsigned char)*valp)) valp++; - if (*valp == '\0' || *valp == '#') + if (*valp == '\0') goto bad; /* Check for dups. */ @@ -346,7 +346,7 @@ parse_setentry(char *line, size_t len, size_t lineno) keyp = line; while (isspace((unsigned char)*keyp)) keyp++; - if (*keyp == '\0' || *keyp == '#') + if (*keyp == '\0') return 1; val.data = "<set>"; |