From 7d1abf6ddeb956998dd360fb7287733f82ab03d5 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 24 Nov 2011 10:44:56 +0000 Subject: [PATCH] Allow man.conf file to be assignable. --- manpath.c | 8 ++++---- manpath.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manpath.c b/manpath.c index 7d5492bf..81c5b6a5 100644 --- a/manpath.c +++ b/manpath.c @@ -1,4 +1,4 @@ -/* $Id: manpath.c,v 1.2 2011/11/24 10:43:55 kristaps Exp $ */ +/* $Id: manpath.c,v 1.3 2011/11/24 10:44:56 kristaps Exp $ */ /* * Copyright (c) 2011 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons @@ -123,7 +123,7 @@ manpath_parseconf(struct manpaths *dirs) free(buf); pclose(stream); #else - manpath_manconf(dirs); + manpath_manconf(MAN_CONF_FILE, dirs); #endif } @@ -139,7 +139,7 @@ manpath_free(struct manpaths *p) } void -manpath_manconf(struct manpaths *dirs) +manpath_manconf(const char *file, struct manpaths *dirs) { FILE *stream; char *p, *q; @@ -148,7 +148,7 @@ manpath_manconf(struct manpaths *dirs) keysz = strlen(MAN_CONF_KEY); assert(keysz > 0); - if (NULL == (stream = fopen(MAN_CONF_FILE, "r"))) + if (NULL == (stream = fopen(file, "r"))) return; while (NULL != (p = fgetln(stream, &len))) { diff --git a/manpath.h b/manpath.h index 421fa650..e60558c5 100644 --- a/manpath.h +++ b/manpath.h @@ -1,4 +1,4 @@ -/* $Id: manpath.h,v 1.2 2011/11/24 10:43:55 kristaps Exp $ */ +/* $Id: manpath.h,v 1.3 2011/11/24 10:44:56 kristaps Exp $ */ /* * Copyright (c) 2011 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons @@ -29,7 +29,7 @@ struct manpaths { __BEGIN_DECLS -void manpath_manconf(struct manpaths *); +void manpath_manconf(const char *, struct manpaths *); void manpath_parse(struct manpaths *, char *, char *); void manpath_parseconf(struct manpaths *); void manpath_parseline(struct manpaths *, char *); -- 2.47.1