Deleted Added
full compact
1c1
< /* $Id: manpath.c,v 1.15 2014/04/23 21:06:41 schwarze Exp $ */
---
> /* $Id: manpath.c,v 1.19 2014/11/27 00:30:40 schwarze Exp $ */
3c3
< * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
---
> * Copyright (c) 2011, 2014 Ingo Schwarze <schwarze@openbsd.org>
18d17
< #ifdef HAVE_CONFIG_H
20d18
< #endif
21a20,22
> #include <sys/types.h>
> #include <sys/stat.h>
>
35,36c36,37
< static void manpath_add(struct manpaths *, const char *);
< static void manpath_parseline(struct manpaths *, char *);
---
> static void manpath_add(struct manpaths *, const char *, int);
> static void manpath_parseline(struct manpaths *, char *, int);
42c43
< #ifdef USE_MANPATH
---
> #if HAVE_MANPATH
82c83
< manpath_parseline(dirs, buf);
---
> manpath_parseline(dirs, buf, 1);
91c92
< manpath_parseline(dirs, auxp);
---
> manpath_parseline(dirs, auxp, 1);
95c96
< manpath_parseline(dirs, defp);
---
> manpath_parseline(dirs, defp, 1);
113c114
< manpath_parseline(dirs, defp);
---
> manpath_parseline(dirs, defp, 0);
119c120
< manpath_parseline(dirs, defp);
---
> manpath_parseline(dirs, defp, 0);
128c129
< manpath_parseline(dirs, defp);
---
> manpath_parseline(dirs, defp, 0);
130c131
< manpath_parseline(dirs, insert + 1);
---
> manpath_parseline(dirs, insert + 1, 0);
135c136
< manpath_parseline(dirs, defp);
---
> manpath_parseline(dirs, defp, 0);
143c144
< manpath_parseline(struct manpaths *dirs, char *path)
---
> manpath_parseline(struct manpaths *dirs, char *path, int complain)
151c152
< manpath_add(dirs, dir);
---
> manpath_add(dirs, dir, complain);
159c160
< manpath_add(struct manpaths *dirs, const char *dir)
---
> manpath_add(struct manpaths *dirs, const char *dir, int complain)
161a163
> struct stat sb;
165c167,171
< if (NULL == (cp = realpath(dir, buf)))
---
> if (NULL == (cp = realpath(dir, buf))) {
> if (complain) {
> fputs("manpath: ", stderr);
> perror(dir);
> }
166a173
> }
171a179,186
> if (stat(cp, &sb) == -1) {
> if (complain) {
> fputs("manpath: ", stderr);
> perror(dir);
> }
> return;
> }
>
218c233
< manpath_add(dirs, p);
---
> manpath_add(dirs, p, 0);