diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-12-09 11:18:57 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-12-09 11:18:57 +0000 |
commit | 60d1dd973fb96a6d36fd0a329ed15239546e5d63 (patch) | |
tree | af93180e50e1c94fa548dafbe47f356fe0fc789f | |
parent | 9adaed882f55a44e620a0cea5e7980bdaf04dccb (diff) | |
download | mandoc-60d1dd973fb96a6d36fd0a329ed15239546e5d63.tar.gz mandoc-60d1dd973fb96a6d36fd0a329ed15239546e5d63.tar.zst mandoc-60d1dd973fb96a6d36fd0a329ed15239546e5d63.zip |
When specifying an architecture to whatis(1)/apropos(1)/man.cgi(7), do a
comparison only if the manual specifies an architecture, otherwise let it
through. Looked over by schwarze@. This brings us much more in line with
OpenBSD's behaviour.
-rw-r--r-- | apropos_db.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apropos_db.c b/apropos_db.c index d618174a..3eca9874 100644 --- a/apropos_db.c +++ b/apropos_db.c @@ -1,4 +1,4 @@ -/* $Id: apropos_db.c,v 1.21 2011/12/03 18:47:09 kristaps Exp $ */ +/* $Id: apropos_db.c,v 1.22 2011/12/09 11:18:57 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -541,8 +541,10 @@ single_search(struct rectree *tree, const struct opts *opts, if (opts->cat && strcasecmp(opts->cat, r.res.cat)) continue; - if (opts->arch && strcasecmp(opts->arch, r.res.arch)) - continue; + + if (opts->arch && *r.res.arch) + if (strcasecmp(opts->arch, r.res.arch)) + continue; tree->node = rs = mandoc_realloc (rs, (tree->len + 1) * sizeof(struct rec)); |