diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2015-10-07 14:40:44 +0200 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2015-10-07 14:43:55 +0200 |
commit | df553b586b7c11fc660bb1829c339fb005bbbead (patch) | |
tree | ed79066e99ea0873a0bf7898ae667892000cdb2a /src/basic/env-util.c | |
parent | 42911a567dc22c3115fb3ee3c56a7dcfb034f102 (diff) |
basic: fix env expansion for strings leading with two dollar signs
The way to escape a literal dollar sign is to write "$$". But this does
not work right if it's at the beginning of the argument. Fix it.
Diffstat (limited to 'src/basic/env-util.c')
-rw-r--r-- | src/basic/env-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 4804a67f91..ecb2192c4d 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -541,7 +541,7 @@ char **replace_env_argv(char **argv, char **env) { STRV_FOREACH(i, argv) { /* If $FOO appears as single word, replace it by the split up variable */ - if ((*i)[0] == '$' && (*i)[1] != '{') { + if ((*i)[0] == '$' && (*i)[1] != '{' && (*i)[1] != '$') { char *e; char **w, **m = NULL; unsigned q; |