option: Do not expand options, obtained from XDG vars

It is a wrong thing to do, this makes valid variable values be treated 
incorrectly: in

    XDG_DATA_HOME='/home/$foo/.local/share'

`$foo` should be treated literally and not expanded to `foo` environment 
variable value.

Also makes option_expand not try to expand too long strings even if these too 
long strings are default values. Previously it thought that default values 
should always be expanded. Also does not try to expand NULL should it be the 
default value just in case.

Fixes #4961
This commit is contained in:
ZyX
2016-06-25 23:39:16 +03:00
parent 5573e1a350
commit 895f712df8
4 changed files with 23 additions and 14 deletions

View File

@@ -165,7 +165,7 @@ return {
deny_duplicates=true,
secure=true,
vi_def=true,
expand=true,
expand='nodefault',
varname='p_bdir',
defaults={if_true={vi=''}}
},
@@ -616,7 +616,7 @@ return {
deny_duplicates=true,
secure=true,
vi_def=true,
expand=true,
expand='nodefault',
varname='p_dir',
defaults={if_true={vi=''}}
},
@@ -1891,7 +1891,7 @@ return {
deny_duplicates=true,
secure=true,
vi_def=true,
expand=true,
expand='nodefault',
varname='p_rtp',
defaults={if_true={vi=''}}
},
@@ -2507,7 +2507,7 @@ return {
deny_duplicates=true,
secure=true,
vi_def=true,
expand=true,
expand='nodefault',
varname='p_udir',
defaults={if_true={vi=''}}
},
@@ -2568,7 +2568,7 @@ return {
type='string', scope={'global'},
secure=true,
vi_def=true,
expand=true,
expand='nodefault',
varname='p_vdir',
defaults={if_true={vi=''}}
},