summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-12-10 16:53:39 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-12-10 16:53:39 +0000
commit51947e6b3e08cfaae752bef72751eef476633755 (patch)
tree866433da6c8eed3a72913f81da6ae079a50655ea
parent5213c2bfeb4ba70af1b9035f00fd4bd72a86971a (diff)
downloadmandoc-51947e6b3e08cfaae752bef72751eef476633755.tar.gz
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@.
-rw-r--r--mandocdb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index fb4de94f..400d1626 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -579,14 +579,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;
}
@@ -1559,6 +1559,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