From: sunil Date: Mon, 26 Oct 2015 16:38:06 +0000 (+0000) Subject: Fix makemap(8) for values containing a '#'. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=be16a31fd53da3adb1aac0547256c76f6cbbb98f;p=openbsd Fix makemap(8) for values containing a '#'. Ok millert@ gilles@ --- 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 @@ -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 = "";