aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-08-23 10:59:38 +0100
committerRon Yorston <rmy@pobox.com>2020-08-23 10:59:38 +0100
commit5dbbfe22dd28c3b3ecd5763cc8e60406136e87ce (patch)
tree64c983708f9f2a21a2fbec14a06d85057d886dfd /libbb
parent64ecd10486934c12336dac84c67a1939dce0e096 (diff)
parenta949399d178f7b052ada2099c62621736eafce44 (diff)
downloadbusybox-w32-5dbbfe22dd28c3b3ecd5763cc8e60406136e87ce.tar.gz
busybox-w32-5dbbfe22dd28c3b3ecd5763cc8e60406136e87ce.tar.bz2
busybox-w32-5dbbfe22dd28c3b3ecd5763cc8e60406136e87ce.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb')
-rw-r--r--libbb/Config.src2
-rw-r--r--libbb/Kbuild.src3
-rw-r--r--libbb/last_char_is.c15
3 files changed, 7 insertions, 13 deletions
diff --git a/libbb/Config.src b/libbb/Config.src
index 312aa1831..f97de8ef7 100644
--- a/libbb/Config.src
+++ b/libbb/Config.src
@@ -334,7 +334,6 @@ config FEATURE_VERBOSE_CP_MESSAGE
334config FEATURE_USE_SENDFILE 334config FEATURE_USE_SENDFILE
335 bool "Use sendfile system call" 335 bool "Use sendfile system call"
336 default y 336 default y
337 select PLATFORM_LINUX
338 help 337 help
339 When enabled, busybox will use the kernel sendfile() function 338 When enabled, busybox will use the kernel sendfile() function
340 instead of read/write loops to copy data between file descriptors 339 instead of read/write loops to copy data between file descriptors
@@ -376,7 +375,6 @@ config FEATURE_SKIP_ROOTFS
376config MONOTONIC_SYSCALL 375config MONOTONIC_SYSCALL
377 bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" 376 bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
378 default y 377 default y
379 select PLATFORM_LINUX
380 help 378 help
381 Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring 379 Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
382 time intervals (time, ping, traceroute etc need this). 380 time intervals (time, ping, traceroute etc need this).
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index dab1e6dae..d7cbb7ff1 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -116,7 +116,8 @@ lib-$(CONFIG_PLATFORM_POSIX) += warn_ignoring_args.o
116lib-$(CONFIG_PLATFORM_POSIX) += write.o 116lib-$(CONFIG_PLATFORM_POSIX) += write.o
117lib-$(CONFIG_PLATFORM_POSIX) += xgethostbyname.o 117lib-$(CONFIG_PLATFORM_POSIX) += xgethostbyname.o
118 118
119lib-$(CONFIG_PLATFORM_LINUX) += match_fstype.o 119lib-$(CONFIG_MOUNT) += match_fstype.o
120lib-$(CONFIG_UMOUNT) += match_fstype.o
120 121
121lib-$(CONFIG_FEATURE_UTMP) += utmp.o 122lib-$(CONFIG_FEATURE_UTMP) += utmp.o
122 123
diff --git a/libbb/last_char_is.c b/libbb/last_char_is.c
index 918526e6c..fba05f974 100644
--- a/libbb/last_char_is.c
+++ b/libbb/last_char_is.c
@@ -11,14 +11,9 @@
11/* Find out if the last character of a string matches the one given */ 11/* Find out if the last character of a string matches the one given */
12char* FAST_FUNC last_char_is(const char *s, int c) 12char* FAST_FUNC last_char_is(const char *s, int c)
13{ 13{
14 if (s) { 14 if (!s[0])
15 size_t sz = strlen(s); 15 return NULL;
16 /* Don't underrun the buffer if the string length is 0 */ 16 while (s[1])
17 if (sz != 0) { 17 s++;
18 s += sz - 1; 18 return (*s == (char)c) ? (char *) s : NULL;
19 if ((unsigned char)*s == c)
20 return (char*)s;
21 }
22 }
23 return NULL;
24} 19}