diff options
author | 2009-07-28 20:51:50 +0000 | |
---|---|---|
committer | 2009-07-28 20:51:50 +0000 | |
commit | 943d4c41f0dca3a5f8588b3c508748c399340bc3 (patch) | |
tree | 4731d356b80f67587c186a04f5e5030c9e5bb13b | |
parent | Add bsd.mp to MDEXT (diff) | |
download | wireguard-openbsd-943d4c41f0dca3a5f8588b3c508748c399340bc3.tar.xz wireguard-openbsd-943d4c41f0dca3a5f8588b3c508748c399340bc3.zip |
slightly change how makemap parses its lines so that we consider #
as a comment only when it starts a line or is preceded by whitespaces.
fixes a bug that was reported to me twice and which i ran into,
ok jacekm@
-rw-r--r-- | usr.sbin/smtpd/makemap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c index bea29b68d2b..81bd15943ad 100644 --- a/usr.sbin/smtpd/makemap.c +++ b/usr.sbin/smtpd/makemap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makemap.c,v 1.18 2009/05/30 23:53:41 gilles Exp $ */ +/* $OpenBSD: makemap.c,v 1.19 2009/07/28 20:51:50 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -186,7 +186,7 @@ parse_map(char *filename) char *line; size_t len; size_t lineno = 0; - char delim[] = { '\\', '\\', '#' }; + char delim[] = { '\\', 0, 0 }; fp = fopen(filename, "r"); if (fp == NULL) { @@ -227,7 +227,7 @@ parse_entry(char *line, size_t len, size_t lineno) keyp = line; while (isspace(*keyp)) keyp++; - if (*keyp == '\0') + if (*keyp == '\0' || *keyp == '#') return 1; valp = keyp; |