aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-04-26 00:43:08 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-04-26 00:43:08 +1200
commitcdd40f6e637965bf8bfd091a4ecc24c50fb0ef29 (patch)
tree70a08fc3d5e64b612cdf07aa4b094e508df094d7
parentMerge branch 'hotfix/v8.20.2' into develop (diff)
parentBump VERSION (diff)
downloaddotfiles-cdd40f6e637965bf8bfd091a4ecc24c50fb0ef29.tar.gz
dotfiles-cdd40f6e637965bf8bfd091a4ecc24c50fb0ef29.zip
Merge branch 'hotfix/v8.20.3' into develop
* hotfix/v8.20.3: Backport environment checking to Vim 8.1
-rw-r--r--VERSION4
-rw-r--r--vim/autoload/xdg.vim10
2 files changed, 9 insertions, 5 deletions
diff --git a/VERSION b/VERSION
index f68eb207..9f780f75 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v8.20.2
-Sat, 25 Apr 2020 11:03:00 +0000
+tejr dotfiles v8.20.3
+Sat, 25 Apr 2020 12:41:34 +0000
diff --git a/vim/autoload/xdg.vim b/vim/autoload/xdg.vim
index 14aa3055..2b1e7c56 100644
--- a/vim/autoload/xdg.vim
+++ b/vim/autoload/xdg.vim
@@ -11,9 +11,13 @@ let s:subdir = 'vim'
function! s:Get(name) abort
let name = a:name
- let env = environ()
- if has_key(env, name) && strlen(env[name]) > 0
- return env[name]
+ if name !~# '^[A-Z][A-Z0-9_]*$'
+ throw 'Illegal env var name'
+ endif
+ let value = ''
+ execute 'let value = $'.name
+ if value !=# ''
+ return value
elseif has_key(s:defaults, name)
return s:defaults[name]
else