aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-05-28 09:58:43 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-05-28 09:58:43 +0200
commit5d7cca209085b31cc53df443d9439a0684646a77 (patch)
tree54a88f0ca760d87931b5fa3c2d52dd650537d993
parentdd6b21192112711f1b7e89e998891f17f9c21c8d (diff)
downloadbusybox-w32-5d7cca209085b31cc53df443d9439a0684646a77.tar.gz
busybox-w32-5d7cca209085b31cc53df443d9439a0684646a77.tar.bz2
busybox-w32-5d7cca209085b31cc53df443d9439a0684646a77.zip
hush: optimize type builtin a bit more
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c11
1 files changed, 5 insertions, 6 deletions
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)
6785 type = "a shell builtin"; 6785 type = "a shell builtin";
6786 else if ((path = find_in_path(*argv)) != NULL) 6786 else if ((path = find_in_path(*argv)) != NULL)
6787 type = path; 6787 type = path;
6788 6788 else {
6789 if (!type) {
6790 bb_error_msg("type: %s: not found", *argv); 6789 bb_error_msg("type: %s: not found", *argv);
6791 ret = EXIT_FAILURE; 6790 ret = EXIT_FAILURE;
6792 } else 6791 continue;
6793 printf("%s is %s\n", *argv, type); 6792 }
6794 6793
6795 if (path) 6794 printf("%s is %s\n", *argv, type);
6796 free(path); 6795 free(path);
6797 } 6796 }
6798 6797
6799 return ret; 6798 return ret;