From b6d863a4fd9e39d57ad3e8bf4e977c9b0997c355 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 3 Dec 2015 05:45:04 +0100 Subject: get LIBRARIAN_PATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/librarian.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/librarian.c b/src/librarian.c index f0441fb..99142a3 100644 --- a/src/librarian.c +++ b/src/librarian.c @@ -31,6 +31,15 @@ +/** + * Default value for the environment variable LIBRARIAN_PATH. + */ +#ifndef DEFAULT_PATH +# define DEFAULT_PATH "/usr/local/share/librarian:/usr/share/librarian" +#endif + + + /** * The name of the process. */ @@ -272,6 +281,7 @@ int main(int argc, char *argv[]) char **variables_last = argv; struct library *libraries = NULL; struct library *libraries_last; + const char *path; /* Parse arguments. */ argv0 = argv ? (argc--, *argv++) : "pp"; @@ -312,6 +322,11 @@ int main(int argc, char *argv[]) goto usage; } + /* Get LIBRARIAN_PATH. */ + path = getenv("LIBRARIAN_PATH"); + if (!path || !*path) + path = DEFAULT_PATH + CLEANUP; return 0; -- cgit v1.2.3-70-g09d2