diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-15 14:41:20 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-15 15:15:30 +0100 |
| commit | b668e52c906b664b353d5a99cfa3ff36f73b341d (patch) | |
| tree | 85ab744c5dd15c21633b89a518ff001225c98494 /shell | |
| parent | 9e8f8a196838b63acdbd2c9b48a2a333bc885e8b (diff) | |
| download | busybox-w32-b668e52c906b664b353d5a99cfa3ff36f73b341d.tar.gz busybox-w32-b668e52c906b664b353d5a99cfa3ff36f73b341d.tar.bz2 busybox-w32-b668e52c906b664b353d5a99cfa3ff36f73b341d.zip | |
*: placate warnings where strchr/strstr returns constant pointer
Newer glibc is now smarter and can propagate const-ness from those!
function old new delta
readtoken1 3111 3108 -3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/ash.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c index 4f824e1b2..19623a9a0 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -8725,7 +8725,7 @@ test_exec(/*const char *fullname,*/ struct stat *statb) | |||
| 8725 | } | 8725 | } |
| 8726 | 8726 | ||
| 8727 | /* Circular dep: find_command->find_builtin->builtintab[]->hashcmd->find_command */ | 8727 | /* Circular dep: find_command->find_builtin->builtintab[]->hashcmd->find_command */ |
| 8728 | static struct builtincmd *find_builtin(const char *name); | 8728 | static const struct builtincmd *find_builtin(const char *name); |
| 8729 | #if ENABLE_ASH_BASH_NOT_FOUND_HOOK | 8729 | #if ENABLE_ASH_BASH_NOT_FOUND_HOOK |
| 8730 | static int evalfun(struct funcnode *func, int argc, char **argv, int flags); | 8730 | static int evalfun(struct funcnode *func, int argc, char **argv, int flags); |
| 8731 | #endif | 8731 | #endif |
| @@ -8746,7 +8746,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) | |||
| 8746 | struct stat statb; | 8746 | struct stat statb; |
| 8747 | int e; | 8747 | int e; |
| 8748 | int updatetbl; | 8748 | int updatetbl; |
| 8749 | struct builtincmd *bcmd; | 8749 | const struct builtincmd *bcmd; |
| 8750 | int len; | 8750 | int len; |
| 8751 | 8751 | ||
| 8752 | /* If name contains a slash, don't use PATH or hash table */ | 8752 | /* If name contains a slash, don't use PATH or hash table */ |
| @@ -10836,10 +10836,10 @@ static const struct builtincmd builtintab[] = { | |||
| 10836 | /* | 10836 | /* |
| 10837 | * Search the table of builtin commands. | 10837 | * Search the table of builtin commands. |
| 10838 | */ | 10838 | */ |
| 10839 | static struct builtincmd * | 10839 | static const struct builtincmd * |
| 10840 | find_builtin(const char *name) | 10840 | find_builtin(const char *name) |
| 10841 | { | 10841 | { |
| 10842 | struct builtincmd *bp; | 10842 | const struct builtincmd *bp; |
| 10843 | 10843 | ||
| 10844 | bp = bsearch( | 10844 | bp = bsearch( |
| 10845 | name, builtintab, ARRAY_SIZE(builtintab), sizeof(builtintab[0]), | 10845 | name, builtintab, ARRAY_SIZE(builtintab), sizeof(builtintab[0]), |
| @@ -12927,12 +12927,12 @@ decode_dollar_squote(void) | |||
| 12927 | { | 12927 | { |
| 12928 | static const char C_escapes[] ALIGN1 = "nrbtfav""x\\01234567"; | 12928 | static const char C_escapes[] ALIGN1 = "nrbtfav""x\\01234567"; |
| 12929 | int c, cnt; | 12929 | int c, cnt; |
| 12930 | char *p; | ||
| 12931 | char buf[4]; | 12930 | char buf[4]; |
| 12932 | 12931 | ||
| 12933 | c = pgetc(); | 12932 | c = pgetc(); |
| 12934 | p = strchr(C_escapes, c); | 12933 | if (strchr(C_escapes, c)) { |
| 12935 | if (p) { | 12934 | char *p; |
| 12935 | |||
| 12936 | buf[0] = c; | 12936 | buf[0] = c; |
| 12937 | p = buf; | 12937 | p = buf; |
| 12938 | cnt = 3; | 12938 | cnt = 3; |
