diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2011-12-10 16:53:39 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2011-12-10 16:53:39 +0000 |
commit | dfc7327f4f68a2114a1ee5a65c95267a70fccbbc (patch) | |
tree | fbf85896f2337c3e41364421dfbbe81615f7ce09 | |
parent | d8f8beddc77d7030b0f7ab279ed9e92d73bba1fa (diff) | |
download | mandoc-dfc7327f4f68a2114a1ee5a65c95267a70fccbbc.tar.gz mandoc-dfc7327f4f68a2114a1ee5a65c95267a70fccbbc.tar.zst mandoc-dfc7327f4f68a2114a1ee5a65c95267a70fccbbc.zip |
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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.31 2011/12/09 11:16:34 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.32 2011/12/10 16:53:39 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -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 |