From 240a1cfbbe6cf42e8013ce06cb567b3f28c8727f Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 8 Apr 2007 16:07:02 +0000 Subject: add some missed statics on constant objects. fix few #ifndef ENABLE_xxx # size busybox_old busybox_unstripped text data bss dec hex filename 677152 2920 18208 698280 aa7a8 busybox_old 676420 2920 18208 697548 aa4cc busybox_unstripped --- shell/ash.c | 11 ++++++++--- shell/lash.c | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index a5ffaaf8e..950cdaa02 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -6967,6 +6967,11 @@ tokname(int tok) { static char buf[16]; +//try this: +//if (tok < TSEMI) return tokname_array[tok] + 1; +//sprintf(buf, "\"%s\"", tokname_array[tok] + 1); +//return buf; + if (tok >= TSEMI) buf[0] = '"'; sprintf(buf + (tok >= TSEMI), "%s%c", @@ -6978,15 +6983,15 @@ tokname(int tok) static int pstrcmp(const void *a, const void *b) { - return strcmp((const char *) a, (*(const char *const *) b) + 1); + return strcmp((char*) a, (*(char**) b) + 1); } static const char *const * findkwd(const char *s) { return bsearch(s, tokname_array + KWDOFFSET, - (sizeof(tokname_array) / sizeof(const char *)) - KWDOFFSET, - sizeof(const char *), pstrcmp); + (sizeof(tokname_array) / sizeof(char *)) - KWDOFFSET, + sizeof(char *), pstrcmp); } /* diff --git a/shell/lash.c b/shell/lash.c index 58d770fd8..192900bb6 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -716,11 +716,12 @@ static char * strsep_space(char *string, int * ix) static int expand_arguments(char *command) { + static const char out_of_space[] = "out of space during expansion"; + int total_length = 0, length, i, retval, ix = 0; expand_t expand_result; char *tmpcmd, *cmd, *cmd_copy; char *src, *dst, *var; - const char * const out_of_space = "out of space during expansion"; int flags = GLOB_NOCHECK #ifdef GLOB_BRACE | GLOB_BRACE -- cgit v1.2.3