summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--misc-utils/look.15
-rw-r--r--misc-utils/look.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/misc-utils/look.1 b/misc-utils/look.1
index 503e38584..cca83416e 100644
--- a/misc-utils/look.1
+++ b/misc-utils/look.1
@@ -101,6 +101,11 @@ sort -d /etc/passwd -o /tmp/look.dict
look -t: root:foobar /tmp/look.dict
.nf
.RE
+.SH ENVIRONMENT
+.TP
+.B WORDLIST
+Path to a dictionary file. The environment variable has greater priority
+than the dictionary path defined in FILES segment.
.SH FILES
.IP "\fB/usr/share/dict/words\fR" 4
the dictionary
diff --git a/misc-utils/look.c b/misc-utils/look.c
index 60fbbbfca..d2699bfdd 100644
--- a/misc-utils/look.c
+++ b/misc-utils/look.c
@@ -104,7 +104,11 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- file = _PATH_WORDS;
+ if ((file = getenv("WORDLIST")) && !access(file, R_OK))
+ /* use the WORDLIST */;
+ else
+ file = _PATH_WORDS;
+
termchar = '\0';
string = NULL; /* just for gcc */