diff options
author | Denys Vlasenko | 2009-05-28 09:58:43 +0200 |
---|---|---|
committer | Denys Vlasenko | 2009-05-28 09:58:43 +0200 |
commit | 5d7cca209085b31cc53df443d9439a0684646a77 (patch) | |
tree | 54a88f0ca760d87931b5fa3c2d52dd650537d993 /shell | |
parent | dd6b21192112711f1b7e89e998891f17f9c21c8d (diff) | |
download | busybox-5d7cca209085b31cc53df443d9439a0684646a77.zip busybox-5d7cca209085b31cc53df443d9439a0684646a77.tar.gz |
hush: optimize type builtin a bit more
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/shell/hush.c b/shell/hush.c index 5000910..cda1c2e 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -6785,15 +6785,14 @@ static int builtin_type(char **argv) type = "a shell builtin"; else if ((path = find_in_path(*argv)) != NULL) type = path; - - if (!type) { + else { bb_error_msg("type: %s: not found", *argv); ret = EXIT_FAILURE; - } else - printf("%s is %s\n", *argv, type); + continue; + } - if (path) - free(path); + printf("%s is %s\n", *argv, type); + free(path); } return ret; |