[git commit] hush: fix PS1 prompth in !EDITING config

Denys Vlasenko vda.linux at googlemail.com
Wed Dec 23 14:29:13 UTC 2020


commit: https://git.busybox.net/busybox/commit/?id=649acb9e235d1fb04e060cf0638bf9d28bb6fd7f
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/hush.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shell/hush.c b/shell/hush.c
index 9403e1f6c..c4381f7a7 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2619,7 +2619,7 @@ static const char *setup_prompt_string(void)
 		/* bash uses $PWD value, even if it is set by user.
 		 * It uses current dir only if PWD is unset.
 		 * We always use current dir. */
-		G.PS1 = xasprintf("%s %c ", get_cwd(0), (geteuid() != 0) ? '$' : '#');
+		prompt_str = G.PS1 = xasprintf("%s %c ", get_cwd(0), (geteuid() != 0) ? '$' : '#');
 	}
 # endif
 	debug_printf("prompt_str '%s'\n", prompt_str);
@@ -2709,14 +2709,14 @@ static int fgetc_interactive(struct in_str *i)
 	}
 	return ch;
 }
-#else
+#else  /* !INTERACTIVE */
 static ALWAYS_INLINE int fgetc_interactive(struct in_str *i)
 {
 	int ch;
 	do ch = hfgetc(i->file); while (ch == '\0');
 	return ch;
 }
-#endif  /* INTERACTIVE */
+#endif  /* !INTERACTIVE */
 
 static int i_getch(struct in_str *i)
 {


More information about the busybox-cvs mailing list