summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-06-05 07:13:54 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-06-05 07:13:54 +0000
commit31f4d5b52a1451d75979ee148509f40db39080a4 (patch)
treecff9a42adc563306affcdf833f63d46f2ffba6e1 /usr.bin
parent2d32938dac145ed9dd08119fd4ca8ab756e4ce24 (diff)
work-around issue in makewhatis, that expects its current dir to NOT be /.
okay aja@, miod@ until Ingo figures things out. (This fixes the ///sr/ports/pobj/p5-YAML-0.84/fake-amd64/usr/local/man/man3p/YAML::Loader::Base.3p: fopen: No such file or directory style errors)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/mandocdb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c
index dd6b7d5182c..67d12270ac0 100644
--- a/usr.bin/mandoc/mandocdb.c
+++ b/usr.bin/mandoc/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.106 2014/05/12 19:11:20 espie Exp $ */
+/* $Id: mandocdb.c,v 1.107 2014/06/05 07:13:53 espie Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -792,7 +792,7 @@ filescan(const char *file)
return;
}
- if (strstr(buf, basedir) == buf)
+ if (strstr(buf, basedir) == buf && strcmp(basedir, "/") != 0)
start = buf + strlen(basedir) + 1;
else if (OP_TEST == op)
start = buf;
@@ -821,7 +821,8 @@ filescan(const char *file)
say(file, "Filename too long");
return;
}
- start = strstr(buf, basedir) == buf ?
+ start = strstr(buf, basedir) == buf &&
+ strcmp(basedir, "/") != 0 ?
buf + strlen(basedir) + 1 : buf;
}