diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2008-07-13 21:51:52 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-07-13 22:27:53 +0800 |
commit | 030462b7c9f42c088e25e782a777383ae4ba1e66 (patch) | |
tree | bf205211b2afedbd4a509550b10e86164cbbdcc1 | |
parent | [INPUT] Made setinputfd static (diff) | |
download | dash-030462b7c9f42c088e25e782a777383ae4ba1e66.tar.gz dash-030462b7c9f42c088e25e782a777383ae4ba1e66.zip |
[SHELL] Expand ENV before using it
Per POSIX ENV needs to undergo parameter expansion. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/main.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 53d5b7c..58bed78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * Made aexpr/oexpr non-recursive. * Made t_lex reentrant. * Made setinputfd static. + * Expand ENV before using it. 2008-05-19 Herbert Xu <herbert@gondor.apana.org.au> diff --git a/src/main.c b/src/main.c index b421e4f..cf34931 100644 --- a/src/main.c +++ b/src/main.c @@ -154,7 +154,7 @@ main(int argc, char **argv) read_profile("/etc/profile"); state1: state = 2; - read_profile(".profile"); + read_profile("$HOME/.profile"); } state2: state = 3; @@ -168,6 +168,7 @@ state2: read_profile(shinit); } } + popstackmark(&smark); state3: state = 4; if (minusc) @@ -259,6 +260,7 @@ read_profile(const char *name) { int skip; + name = expandstr(name); if (setinputfile(name, INPUT_PUSH_FILE | INPUT_NOFILE_OK) < 0) return; |