aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/bbsh.c2
-rw-r--r--shell/hush.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/shell/bbsh.c b/shell/bbsh.c
index 897c0227c..ad875abf5 100644
--- a/shell/bbsh.c
+++ b/shell/bbsh.c
@@ -212,7 +212,7 @@ int bbsh_main(int argc, char **argv)
unsigned cmdlen=0;
for (;;) {
if (!f) putchar('$');
- if (1 > getline(&command, &cmdlen,f ? : stdin)) break;
+ if (1 > getline(&command, &cmdlen, f ? f : stdin)) break;
handle(command);
}
diff --git a/shell/hush.c b/shell/hush.c
index 5794b1ddf..30eddadcc 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -5794,7 +5794,7 @@ static struct pipe *parse_stream(char **pstring,
* found. When recursing, quote state is passed in via dest->o_escape.
*/
debug_printf_parse("parse_stream entered, end_trigger='%c'\n",
- end_trigger ? : 'X');
+ end_trigger ? end_trigger : 'X');
debug_enter();
G.ifs = get_local_var_value("IFS");
@@ -6860,7 +6860,8 @@ static int FAST_FUNC builtin_cd(char **argv)
* bash says "bash: cd: HOME not set" and does nothing
* (exitcode 1)
*/
- newdir = get_local_var_value("HOME") ? : "/";
+ const char *home = get_local_var_value("HOME");
+ newdir = home ? home : "/";
}
if (chdir(newdir)) {
/* Mimic bash message exactly */