-/* $Id: manpath.c,v 1.25 2015/05/07 12:08:13 schwarze Exp $ */
+/* $Id: manpath.c,v 1.27 2015/10/11 21:12:55 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
#include <sys/stat.h>
#include <ctype.h>
+#include <err.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include "mandoc_aux.h"
#include "manconf.h"
+#if !HAVE_MANPATH
static void manconf_file(struct manconf *, const char *);
+#endif
static void manpath_add(struct manpaths *, const char *, int);
static void manpath_parseline(struct manpaths *, char *, int);
size_t i;
if (NULL == (cp = realpath(dir, buf))) {
- if (complain) {
- fputs("manpath: ", stderr);
- perror(dir);
- }
+ if (complain)
+ warn("manpath: %s", dir);
return;
}
return;
if (stat(cp, &sb) == -1) {
- if (complain) {
- fputs("manpath: ", stderr);
- perror(dir);
- }
+ if (complain)
+ warn("manpath: %s", dir);
return;
}
free(conf->output.style);
}
+#if !HAVE_MANPATH
static void
manconf_file(struct manconf *conf, const char *file)
{
if (*manpath_default != '\0')
manpath_parseline(&conf->manpath, manpath_default, 0);
}
+#endif
void
manconf_output(struct manoutput *conf, const char *cp)