summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-12-10 16:53:39 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-12-10 16:53:39 +0000
commitb8579b74ff1892006eaa65985341c07bc58614fc (patch)
tree4a3176cd96d09e4d42cc9bbe5016909e4dee5509 /usr.bin
parentb9669a8d3fc4610c2b3c85c26ed6ea8a7f8edc5e (diff)
Fix selection of arch-specific manuals:
(1) Correctly compare cat vs. man paths. (2) Compare arch (and section) names case-insensitively. Problem noticed by kristaps@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/mandocdb.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c
index 22dcd4228e3..1f68b9a6469 100644
--- a/usr.bin/mandoc/mandocdb.c
+++ b/usr.bin/mandoc/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.22 2011/12/09 01:47:11 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.23 2011/12/10 16:53:38 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -567,14 +567,14 @@ index_merge(const struct of *of, struct mparse *mp,
if (0 == use_all) {
assert(of->sec);
assert(msec);
- if (strcmp(msec, of->sec))
+ if (strcasecmp(msec, of->sec))
continue;
if (NULL == arch) {
if (NULL != of->arch)
continue;
} else if (NULL == of->arch ||
- strcmp(arch, of->arch))
+ strcasecmp(arch, of->arch))
continue;
}
@@ -1547,6 +1547,10 @@ ofile_dirbuild(const char *dir, const char* psec, const char *parch,
buf[0] = '\0';
strlcat(buf, dir, MAXPATHLEN);
p = strrchr(buf, '/');
+ if (NULL != parch && NULL != p)
+ for (p--; p > buf; p--)
+ if ('/' == *p)
+ break;
if (NULL == p)
p = buf;
else