version 1.25, 2015/05/07 12:08:13 |
version 1.27, 2015/10/11 21:12:55 |
|
|
#include <sys/stat.h> |
#include <sys/stat.h> |
|
|
#include <ctype.h> |
#include <ctype.h> |
|
#include <err.h> |
#include <limits.h> |
#include <limits.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
|
#include "mandoc_aux.h" |
#include "mandoc_aux.h" |
#include "manconf.h" |
#include "manconf.h" |
|
|
|
#if !HAVE_MANPATH |
static void manconf_file(struct manconf *, const char *); |
static void manconf_file(struct manconf *, const char *); |
|
#endif |
static void manpath_add(struct manpaths *, const char *, int); |
static void manpath_add(struct manpaths *, const char *, int); |
static void manpath_parseline(struct manpaths *, char *, int); |
static void manpath_parseline(struct manpaths *, char *, int); |
|
|
Line 163 manpath_add(struct manpaths *dirs, const char *dir, in |
|
Line 166 manpath_add(struct manpaths *dirs, const char *dir, in |
|
size_t i; |
size_t i; |
|
|
if (NULL == (cp = realpath(dir, buf))) { |
if (NULL == (cp = realpath(dir, buf))) { |
if (complain) { |
if (complain) |
fputs("manpath: ", stderr); |
warn("manpath: %s", dir); |
perror(dir); |
|
} |
|
return; |
return; |
} |
} |
|
|
Line 175 manpath_add(struct manpaths *dirs, const char *dir, in |
|
Line 176 manpath_add(struct manpaths *dirs, const char *dir, in |
|
return; |
return; |
|
|
if (stat(cp, &sb) == -1) { |
if (stat(cp, &sb) == -1) { |
if (complain) { |
if (complain) |
fputs("manpath: ", stderr); |
warn("manpath: %s", dir); |
perror(dir); |
|
} |
|
return; |
return; |
} |
} |
|
|
Line 203 manconf_free(struct manconf *conf) |
|
Line 202 manconf_free(struct manconf *conf) |
|
free(conf->output.style); |
free(conf->output.style); |
} |
} |
|
|
|
#if !HAVE_MANPATH |
static void |
static void |
manconf_file(struct manconf *conf, const char *file) |
manconf_file(struct manconf *conf, const char *file) |
{ |
{ |
|
|
if (*manpath_default != '\0') |
if (*manpath_default != '\0') |
manpath_parseline(&conf->manpath, manpath_default, 0); |
manpath_parseline(&conf->manpath, manpath_default, 0); |
} |
} |
|
#endif |
|
|
void |
void |
manconf_output(struct manoutput *conf, const char *cp) |
manconf_output(struct manoutput *conf, const char *cp) |