diff options
Diffstat (limited to '')
-rw-r--r-- | bin/1sh/parser.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/1sh/parser.c b/bin/1sh/parser.c index 377ab78f..39b36e67 100644 --- a/bin/1sh/parser.c +++ b/bin/1sh/parser.c @@ -2039,6 +2039,16 @@ expandprompt(const char *fmt) { break; /* + * Exit status if non-zero. + */ + case '?': + if (exitstatus != 0) + snprintf(&ps[i], PROMPTLEN - i, "%d", exitstatus); + else + i--; + break; + + /* * Superuser status. * * '$' for normal users, '#' for root. |