From 31f4d5b52a1451d75979ee148509f40db39080a4 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Thu, 5 Jun 2014 07:13:54 +0000 Subject: 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) --- usr.bin/mandoc/mandocdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.bin') 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 * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -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; } -- cgit v1.2.3