From: Denys Vlasenko Date: Thu, 28 May 2009 07:58:43 +0000 (+0200) Subject: hush: optimize type builtin a bit more X-Git-Tag: 1_15_0~208 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5d7cca209085b31cc53df443d9439a0684646a77;p=oweals%2Fbusybox.git hush: optimize type builtin a bit more Signed-off-by: Denys Vlasenko --- diff --git a/shell/hush.c b/shell/hush.c index 500091066..cda1c2e74 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;