aboutsummaryrefslogtreecommitdiff
path: root/libbb/concat_path_file.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-01-04 07:58:00 +0000
committerRon Yorston <rmy@pobox.com>2024-01-04 07:58:00 +0000
commit9197a9ef026e3d57d291f05ea6f91956d152d116 (patch)
tree57eaef12ecb831422c66d95ba0c2022bbfd7f50d /libbb/concat_path_file.c
parent306601c86fa1cc6c210b7f18d597b8c0821ab19a (diff)
downloadbusybox-w32-9197a9ef026e3d57d291f05ea6f91956d152d116.tar.gz
busybox-w32-9197a9ef026e3d57d291f05ea6f91956d152d116.tar.bz2
busybox-w32-9197a9ef026e3d57d291f05ea6f91956d152d116.zip
libbb: introduce last_char_is_dir_sep()
Add a convenience function to determine if the last character of a string is a directory separator. Adds 16-32 bytes.
Diffstat (limited to 'libbb/concat_path_file.c')
-rw-r--r--libbb/concat_path_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/concat_path_file.c b/libbb/concat_path_file.c
index 81c7481ca..3afb0e3a4 100644
--- a/libbb/concat_path_file.c
+++ b/libbb/concat_path_file.c
@@ -22,8 +22,8 @@ char* FAST_FUNC concat_path_file(const char *path, const char *filename)
22 if (!path) 22 if (!path)
23 path = ""; 23 path = "";
24#if ENABLE_PLATFORM_MINGW32 24#if ENABLE_PLATFORM_MINGW32
25 lc = last_char_is(path, '/') ?: last_char_is(path, '\\'); 25 lc = last_char_is_dir_sep(path);
26 while (*filename == '/' || *filename == '\\') 26 while (is_dir_sep(*filename))
27 filename++; 27 filename++;
28#else 28#else
29 lc = last_char_is(path, '/'); 29 lc = last_char_is(path, '/');