summaryrefslogtreecommitdiff
path: root/shell/builtin_read.c
diff options
context:
space:
mode:
authorDenys Vlasenko2010-01-12 23:29:57 +0100
committerDenys Vlasenko2010-01-12 23:29:57 +0100
commit03dad22f8a1b8b1410fdcccf69af1bb5cce4de7c (patch)
treeb134cbc7f0afbf76c54847624310e6a1d2774f83 /shell/builtin_read.c
parent045f4ad92c07434625e168bc8c37aa0e89f6e58e (diff)
downloadbusybox-03dad22f8a1b8b1410fdcccf69af1bb5cce4de7c.zip
busybox-03dad22f8a1b8b1410fdcccf69af1bb5cce4de7c.tar.gz
hush: use ash's read builtin
function old new delta shell_builtin_read - 1000 +1000 set_local_var_from_halves - 24 +24 setvar2 - 7 +7 ... popstring 140 134 -6 ash_main 1375 1368 -7 setvar 184 174 -10 arith_set_local_var 36 - -36 builtin_read 1096 185 -911 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 5/23 up/down: 1038/-1007) Total: 31 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/builtin_read.c')
-rw-r--r--shell/builtin_read.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/shell/builtin_read.c b/shell/builtin_read.c
index 24cfe08..412bcf8 100644
--- a/shell/builtin_read.c
+++ b/shell/builtin_read.c
@@ -21,7 +21,7 @@
#include "builtin_read.h"
const char* FAST_FUNC
-builtin_read(void (*setvar)(const char *name, const char *val, int flags),
+shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val),
char **argv,
const char *ifs,
int read_flags,
@@ -178,7 +178,7 @@ builtin_read(void (*setvar)(const char *name, const char *val, int flags),
if (argv[1] != NULL && is_ifs) {
buffer[bufpos] = '\0';
bufpos = 0;
- setvar(*argv, buffer, 0);
+ setvar(*argv, buffer);
argv++;
/* can we skip one non-space ifs char? (2: yes) */
startword = isspace(c) ? 2 : 1;
@@ -195,14 +195,14 @@ builtin_read(void (*setvar)(const char *name, const char *val, int flags),
continue;
buffer[bufpos + 1] = '\0';
/* Use the remainder as a value for the next variable */
- setvar(*argv, buffer, 0);
+ setvar(*argv, buffer);
/* Set the rest to "" */
while (*++argv)
- setvar(*argv, "", 0);
+ setvar(*argv, "");
} else {
/* Note: no $IFS removal */
buffer[bufpos] = '\0';
- setvar("REPLY", buffer, 0);
+ setvar("REPLY", buffer);
}
ret: