aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
2035 case 'W': /* basename of cur dir */ 2035 case 'W': /* basename of cur dir */
2036 if (!cwd_buf) { 2036 if (!cwd_buf) {
2037 const char *home; 2037 const char *home;
2038#if ENABLE_SHELL_ASH
2039 cwd_buf = state->sh_get_var
2040 ? xstrdup(state->sh_get_var("PWD"))
2041 : xrealloc_getcwd_or_warn(NULL);
2042#else
2038 cwd_buf = xrealloc_getcwd_or_warn(NULL); 2043 cwd_buf = xrealloc_getcwd_or_warn(NULL);
2044#endif
2039 if (!cwd_buf) 2045 if (!cwd_buf)
2040 cwd_buf = (char *)bb_msg_unknown; 2046 cwd_buf = (char *)bb_msg_unknown;
2041 else if ((home = get_homedir_or_NULL()) != NULL && home[0]) { 2047 else if ((home = get_homedir_or_NULL()) != NULL && home[0]) {