summary refs log tree commit diff
path: root/bin/1sh/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/1sh/parser.c')
-rw-r--r--bin/1sh/parser.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/1sh/parser.c b/bin/1sh/parser.c
index 3f73220f..1038aa43 100644
--- a/bin/1sh/parser.c
+++ b/bin/1sh/parser.c
@@ -2039,6 +2039,18 @@ expandprompt(const char *fmt) {
 				break;
 
 				/*
+				 * Exit status if non-zero.
+				 */
+			case '?':
+				if (exitstatus != 0) {
+					snprintf(&ps[i], PROMPTLEN - i, "%d", exitstatus);
+					while (ps[i] != '\0')
+						i++;
+				}
+				i--;
+				break;
+
+				/*
 				 * Superuser status.
 				 *
 				 * '$' for normal users, '#' for root.
1'>Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe