summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--manpath.c33
-rw-r--r--manpath.h1
2 files changed, 21 insertions, 13 deletions
diff --git a/manpath.c b/manpath.c
index 3b8678cf..7c305e4c 100644
--- a/manpath.c
+++ b/manpath.c
@@ -92,8 +92,8 @@ manpath_add(struct manpaths *dirs, const char *dir)
void
manpath_parseconf(struct manpaths *dirs)
{
- FILE *stream;
#ifdef USE_MANPATH
+ FILE *stream;
char *buf;
size_t sz, bsz;
@@ -123,6 +123,25 @@ manpath_parseconf(struct manpaths *dirs)
free(buf);
pclose(stream);
#else
+ manpath_manconf(dirs);
+#endif
+}
+
+void
+manpath_free(struct manpaths *p)
+{
+ int i;
+
+ for (i = 0; i < p->sz; i++)
+ free(p->paths[i]);
+
+ free(p->paths);
+}
+
+void
+manpath_manconf(struct manpaths *dirs)
+{
+ FILE *stream;
char *p, *q;
size_t len, keysz;
@@ -152,16 +171,4 @@ manpath_parseconf(struct manpaths *dirs)
}
fclose(stream);
-#endif
-}
-
-void
-manpath_free(struct manpaths *p)
-{
- int i;
-
- for (i = 0; i < p->sz; i++)
- free(p->paths[i]);
-
- free(p->paths);
}
diff --git a/manpath.h b/manpath.h
index 0d259280..6b9837aa 100644
--- a/manpath.h
+++ b/manpath.h
@@ -29,6 +29,7 @@ struct manpaths {
__BEGIN_DECLS
+void manpath_manconf(struct manpaths *);
void manpath_parse(struct manpaths *, char *, char *);
void manpath_parseconf(struct manpaths *);
void manpath_parseline(struct manpaths *, char *);