diff options
author | Sami Kerola | 2017-08-12 10:31:11 +0200 |
---|---|---|
committer | Karel Zak | 2017-08-21 10:48:20 +0200 |
commit | a653878c45cd533abbd4950b2fb5ea8c6cef6395 (patch) | |
tree | 5f9efd80bcb90a9beb471c4aa7400e1c86bfe4ad /misc-utils/look.c | |
parent | lslogins: be more explicit with -g in man page (diff) | |
download | kernel-qcow2-util-linux-a653878c45cd533abbd4950b2fb5ea8c6cef6395.tar.gz kernel-qcow2-util-linux-a653878c45cd533abbd4950b2fb5ea8c6cef6395.tar.xz kernel-qcow2-util-linux-a653878c45cd533abbd4950b2fb5ea8c6cef6395.zip |
look: use WORDLIST environment variable to find word list
The WORDLIST is the same hunspell(1) and ispell(1) uses to achieve the same.
Apparently aspell(1) does not work with files like traditional dict lists.
Reference: https://github.com/hunspell/hunspell/blob/master/man/hunspell.1#L388
Reference: http://www.skrenta.com/rt/man/ispell.1.html
Reference: http://aspell.net/man-html/Creating-an-Individual-Word-List.html#Creating-an-Individual-Word-List
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils/look.c')
-rw-r--r-- | misc-utils/look.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 */ |