summaryrefslogtreecommitdiffstats
path: root/bin/sh/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/exec.c')
-rw-r--r--bin/sh/exec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c
index e4948fe..718ef82 100644
--- a/bin/sh/exec.c
+++ b/bin/sh/exec.c
@@ -350,7 +350,10 @@ hashcmd(int argc __unused, char **argv __unused)
if (verbose) {
if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */
cmdp = cmdlookup(name, 0);
- printentry(cmdp, verbose);
+ if (cmdp != NULL)
+ printentry(cmdp, verbose);
+ else
+ outfmt(&errout, "%s: not found\n", name);
}
flushall();
}
OpenPOWER on IntegriCloud