← Commit list

298ac9507

Ron Yorston
Ron Yorston
2022-07-03
SUCCESS Duration: 157s

Subject

lineedit: get PWD from ash

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/lineedit.c+6 -0
@@ -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]) {