diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-05-25 15:24:56 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-05-25 15:24:56 +0200 |
commit | b5be8da350b59ddc1925c485f2acb9c8f5b79b7e (patch) | |
tree | 4f583b28c058d0816a2eb08de822a6be532bc159 /shell | |
parent | 6824298ab4d3da40763af4d2d466a72745b8b593 (diff) | |
download | busybox-w32-b5be8da350b59ddc1925c485f2acb9c8f5b79b7e.tar.gz busybox-w32-b5be8da350b59ddc1925c485f2acb9c8f5b79b7e.tar.bz2 busybox-w32-b5be8da350b59ddc1925c485f2acb9c8f5b79b7e.zip |
hush: make "false" built-in
function old new delta
bltins1 384 396 +12
builtin_false - 6 +6
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 18/0) Total: 18 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c index 1f7b58d4f..cdaa67a3b 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1061,6 +1061,7 @@ static int builtin_export(char **argv) FAST_FUNC; | |||
1061 | #if ENABLE_HUSH_READONLY | 1061 | #if ENABLE_HUSH_READONLY |
1062 | static int builtin_readonly(char **argv) FAST_FUNC; | 1062 | static int builtin_readonly(char **argv) FAST_FUNC; |
1063 | #endif | 1063 | #endif |
1064 | static int builtin_false(char **argv) FAST_FUNC; | ||
1064 | #if ENABLE_HUSH_JOB | 1065 | #if ENABLE_HUSH_JOB |
1065 | static int builtin_fg_bg(char **argv) FAST_FUNC; | 1066 | static int builtin_fg_bg(char **argv) FAST_FUNC; |
1066 | static int builtin_jobs(char **argv) FAST_FUNC; | 1067 | static int builtin_jobs(char **argv) FAST_FUNC; |
@@ -1161,6 +1162,7 @@ static const struct built_in_command bltins1[] ALIGN_PTR = { | |||
1161 | #if ENABLE_HUSH_EXPORT | 1162 | #if ENABLE_HUSH_EXPORT |
1162 | BLTIN("export" , builtin_export , "Set environment variables"), | 1163 | BLTIN("export" , builtin_export , "Set environment variables"), |
1163 | #endif | 1164 | #endif |
1165 | BLTIN("false" , builtin_false , NULL), | ||
1164 | #if ENABLE_HUSH_JOB | 1166 | #if ENABLE_HUSH_JOB |
1165 | BLTIN("fg" , builtin_fg_bg , "Bring job to foreground"), | 1167 | BLTIN("fg" , builtin_fg_bg , "Bring job to foreground"), |
1166 | #endif | 1168 | #endif |
@@ -10831,6 +10833,11 @@ static int FAST_FUNC builtin_true(char **argv UNUSED_PARAM) | |||
10831 | return 0; | 10833 | return 0; |
10832 | } | 10834 | } |
10833 | 10835 | ||
10836 | static int FAST_FUNC builtin_false(char **argv UNUSED_PARAM) | ||
10837 | { | ||
10838 | return 1; | ||
10839 | } | ||
10840 | |||
10834 | #if ENABLE_HUSH_TEST || ENABLE_HUSH_ECHO || ENABLE_HUSH_PRINTF || ENABLE_HUSH_KILL | 10841 | #if ENABLE_HUSH_TEST || ENABLE_HUSH_ECHO || ENABLE_HUSH_PRINTF || ENABLE_HUSH_KILL |
10835 | static NOINLINE int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv)) | 10842 | static NOINLINE int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv)) |
10836 | { | 10843 | { |