Allow braceless variables to be expanded

(Only in environment.d files.)

We have only basic compatibility with shell syntax, but specifying variables
without using braces is probably more common, and I think a lot of people would
be surprised if this didn't work.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-02-20 23:30:50 -05:00
parent cb4499d005
commit ccad1fd07c
6 changed files with 91 additions and 11 deletions
+1
View File
@@ -31,6 +31,7 @@ bool env_assignment_is_valid(const char *e);
enum {
REPLACE_ENV_USE_ENVIRONMENT = 1u,
REPLACE_ENV_ALLOW_BRACELESS = 2u,
};
char *replace_env(const char *format, char **env, unsigned flags);