aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2020-02-16 18:31:05 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2020-02-16 19:16:35 +0100
commite880b1fea8442b623d45a8f62227fc35cbcac7ec (patch)
treed7f36baedaa725a37077edc4a5746ffb82484b7f /shell
parenta7b97e367c44d8a6890397848dcf59f4e190d4f9 (diff)
downloadbusybox-e880b1fea8442b623d45a8f62227fc35cbcac7ec.tar.gz
ash: expand: Use HOME in tilde expansion when it is empty
Upstream commit: Date: Sun, 27 May 2018 17:31:57 +0800 expand: Use HOME in tilde expansion when it is empty Currently if HOME is set to empty tilde expansion will fail, i.e., it will remain as a literal tilde. This patch changes it to return the empty string as required by POSIX. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 78ca1d99c..138f19abd 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6440,7 +6440,7 @@ exptilde(char *startp, char *p, int flags)
goto lose;
home = pw->pw_dir;
}
- if (!home || !*home)
+ if (!home)
goto lose;
*p = c;
strtodest(home, SQSYNTAX, quotes);