diff options
author | Ron Yorston <rmy@pobox.com> | 2021-07-28 12:48:21 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-07-28 12:48:21 +0100 |
commit | 83b78af8033e10e959e7b56c74b1c3c5ee2f8fc5 (patch) | |
tree | dbbb2b8f04260d7874a255f7b1a213055be5c62c /networking | |
parent | 5776a5f8d5bfe83b72dc3d9788e92a2a11b22cd2 (diff) | |
download | busybox-w32-83b78af8033e10e959e7b56c74b1c3c5ee2f8fc5.tar.gz busybox-w32-83b78af8033e10e959e7b56c74b1c3c5ee2f8fc5.tar.bz2 busybox-w32-83b78af8033e10e959e7b56c74b1c3c5ee2f8fc5.zip |
win32: code shrink using is_prefixed_with()
Use is_prefixed_with() rather than strncmp() in a few places,
and the case-insensitive analogues.
Saves 96 bytes in 64-bit build, 192 bytes in 32-bit.
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index fcc49853a..fcd1627b1 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -557,7 +557,12 @@ enum { | |||
557 | } while (0) | 557 | } while (0) |
558 | 558 | ||
559 | 559 | ||
560 | #if !ENABLE_PLATFORM_MINGW32 | ||
560 | #define STRNCASECMP(a, str) strncasecmp((a), (str), sizeof(str)-1) | 561 | #define STRNCASECMP(a, str) strncasecmp((a), (str), sizeof(str)-1) |
562 | #else | ||
563 | /* Not exactly equivalent to strncasecmp(), but OK for its use here */ | ||
564 | #define STRNCASECMP(a, str) (!is_prefixed_with_case((a), (str))) | ||
565 | #endif | ||
561 | 566 | ||
562 | /* Prototypes */ | 567 | /* Prototypes */ |
563 | enum { | 568 | enum { |