version 1.8, 2011/12/24 22:37:16 |
version 1.9, 2012/06/08 10:32:40 |
Line 74 manpath_parse(struct manpaths *dirs, const char *file, |
|
Line 74 manpath_parse(struct manpaths *dirs, const char *file, |
|
|
|
do { |
do { |
buf = mandoc_realloc(buf, bsz + 1024); |
buf = mandoc_realloc(buf, bsz + 1024); |
sz = fread(buf + (int)bsz, 1, 1024, stream); |
sz = fread(buf + bsz, 1, 1024, stream); |
bsz += sz; |
bsz += sz; |
} while (sz > 0); |
} while (sz > 0); |
|
|
Line 117 manpath_parse(struct manpaths *dirs, const char *file, |
|
Line 117 manpath_parse(struct manpaths *dirs, const char *file, |
|
} |
} |
|
|
/* Append man.conf(5) to MANPATH. */ |
/* Append man.conf(5) to MANPATH. */ |
if (':' == defp[(int)strlen(defp) - 1]) { |
if (':' == defp[strlen(defp) - 1]) { |
manpath_parseline(dirs, defp); |
manpath_parseline(dirs, defp); |
manpath_manconf(dirs, file); |
manpath_manconf(dirs, file); |
return; |
return; |
Line 162 manpath_add(struct manpaths *dirs, const char *dir) |
|
Line 162 manpath_add(struct manpaths *dirs, const char *dir) |
|
{ |
{ |
char buf[PATH_MAX]; |
char buf[PATH_MAX]; |
char *cp; |
char *cp; |
int i; |
size_t i; |
|
|
if (NULL == (cp = realpath(dir, buf))) |
if (NULL == (cp = realpath(dir, buf))) |
return; |
return; |
Line 173 manpath_add(struct manpaths *dirs, const char *dir) |
|
Line 173 manpath_add(struct manpaths *dirs, const char *dir) |
|
|
|
dirs->paths = mandoc_realloc |
dirs->paths = mandoc_realloc |
(dirs->paths, |
(dirs->paths, |
((size_t)dirs->sz + 1) * sizeof(char *)); |
(dirs->sz + 1) * sizeof(char *)); |
|
|
dirs->paths[dirs->sz++] = mandoc_strdup(cp); |
dirs->paths[dirs->sz++] = mandoc_strdup(cp); |
} |
} |
Line 181 manpath_add(struct manpaths *dirs, const char *dir) |
|
Line 181 manpath_add(struct manpaths *dirs, const char *dir) |
|
void |
void |
manpath_free(struct manpaths *p) |
manpath_free(struct manpaths *p) |
{ |
{ |
int i; |
size_t i; |
|
|
for (i = 0; i < p->sz; i++) |
for (i = 0; i < p->sz; i++) |
free(p->paths[i]); |
free(p->paths[i]); |