diff options
author | 2009-11-01 23:16:39 +0000 | |
---|---|---|
committer | 2009-11-01 23:16:39 +0000 | |
commit | 96d7036ff6811175998d34de19020ac3169177e4 (patch) | |
tree | 847683bad78ec3120b304b39187ba51732cf860d | |
parent | Move IS[12]BYTEMSG and ISEXTMSG defines to a common place. (diff) | |
download | wireguard-openbsd-96d7036ff6811175998d34de19020ac3169177e4.tar.xz wireguard-openbsd-96d7036ff6811175998d34de19020ac3169177e4.zip |
If the last name field looks like a description rather than an alias (if it
contains spaces), ignore it. Knocks a few K off the termcap and terminfo
databases and gets rid of some warnings.
ok millert
-rw-r--r-- | usr.bin/cap_mkdb/cap_mkdb.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c index a2c899ac63c..890d6e936fb 100644 --- a/usr.bin/cap_mkdb/cap_mkdb.c +++ b/usr.bin/cap_mkdb/cap_mkdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cap_mkdb.c,v 1.16 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: cap_mkdb.c,v 1.17 2009/11/01 23:16:39 nicm Exp $ */ /* $NetBSD: cap_mkdb.c,v 1.5 1995/09/02 05:47:12 jtc Exp $ */ /*- @@ -283,6 +283,16 @@ db_build(char **ifiles) if (p > t && (*p == (info ? ',' : ':') || *p == '|')) { key.size = p - t; key.data = t; + + /* + * If this is the last entry and contains any + * spaces, it is a description rather than an + * alias, so skip it and break. + */ + if (*p != '|' && + memchr(key.data, ' ', key.size) != NULL) + break; + switch(capdbp->put(capdbp, &key, &data, R_NOOVERWRITE)) { case -1: |