diff options
author | Ron Yorston <rmy@pobox.com> | 2022-10-12 10:43:26 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-10-12 10:43:26 +0100 |
commit | 49c6f079acb4edae84b4496bd941cdbb5048ba01 (patch) | |
tree | ac54ecaad45050f7bfe274a11db29882aa32a9a8 /libbb/lineedit.c | |
parent | a55cf07365ec2ff51749a77e09ae9edac79a99fe (diff) | |
parent | c8c1fcdba163f264a503380bc63485aacd09214c (diff) | |
download | busybox-w32-49c6f079acb4edae84b4496bd941cdbb5048ba01.tar.gz busybox-w32-49c6f079acb4edae84b4496bd941cdbb5048ba01.tar.bz2 busybox-w32-49c6f079acb4edae84b4496bd941cdbb5048ba01.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 6994d1da7..c5d5808f5 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -2154,7 +2154,13 @@ static void parse_and_put_prompt(const char *prmt_ptr) | |||
2154 | case 'W': /* basename of cur dir */ | 2154 | case 'W': /* basename of cur dir */ |
2155 | if (!cwd_buf) { | 2155 | if (!cwd_buf) { |
2156 | const char *home; | 2156 | const char *home; |
2157 | #if ENABLE_SHELL_ASH | ||
2158 | cwd_buf = state->sh_get_var | ||
2159 | ? xstrdup(state->sh_get_var("PWD")) | ||
2160 | : xrealloc_getcwd_or_warn(NULL); | ||
2161 | #else | ||
2157 | cwd_buf = xrealloc_getcwd_or_warn(NULL); | 2162 | cwd_buf = xrealloc_getcwd_or_warn(NULL); |
2163 | #endif | ||
2158 | if (!cwd_buf) | 2164 | if (!cwd_buf) |
2159 | cwd_buf = (char *)bb_msg_unknown; | 2165 | cwd_buf = (char *)bb_msg_unknown; |
2160 | else if ((home = get_homedir_or_NULL()) != NULL && home[0]) { | 2166 | else if ((home = get_homedir_or_NULL()) != NULL && home[0]) { |