Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index b685399f9..697f2a577 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -2035,7 +2035,13 @@ static void parse_and_put_prompt(const char *prmt_ptr)
case 'W': /* basename of cur dir */
if (!cwd_buf) {
const char *home;
+#if ENABLE_SHELL_ASH
+ cwd_buf = state->sh_get_var
+ ? xstrdup(state->sh_get_var("PWD"))
+ : xrealloc_getcwd_or_warn(NULL);
+#else
cwd_buf = xrealloc_getcwd_or_warn(NULL);
+#endif
if (!cwd_buf)
cwd_buf = (char *)bb_msg_unknown;
else if ((home = get_homedir_or_NULL()) != NULL && home[0]) {