diff options
author | Randy Palamar <palamar@ualberta.ca> | 2021-03-08 13:31:44 -0700 |
---|---|---|
committer | Randy Palamar <palamar@ualberta.ca> | 2021-03-08 13:31:44 -0700 |
commit | 694fdc1174c82595ac161850f572eade6b126838 (patch) | |
tree | c1b76b03cccfcfb4f0cd7572d4993da3dde1cd5a | |
parent | 6f0b1f64058c394062a295ae5268b42a180bd529 (diff) | |
download | vis-spellcheck-694fdc1174c82595ac161850f572eade6b126838.tar.gz |
check if "LANG" environment variable exists before indexing it
-rw-r--r-- | spellcheck.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spellcheck.lua b/spellcheck.lua index d6bbcb3..d64505c 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -2,7 +2,11 @@ -- Use of this source code is governed by a MIT license found in the LICENSE file. local spellcheck = {} -spellcheck.lang = os.getenv("LANG"):sub(0,5) or "en_US" +if os.getenv("LANG") then + spellcheck.lang = os.getenv("LANG"):sub(0,5) +else + spellcheck.lang = "en_US" +end local supress_stdout = " >/dev/null" local supress_stderr = " 2>/dev/null" local supress_output = supress_stdout .. supress_stderr |