projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7448b51
)
libbb: make is_suffixed_with() return pointer inside string, not key.
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 25 Aug 2015 19:47:33 +0000
(21:47 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 25 Aug 2015 19:47:33 +0000
(21:47 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/compare_string_array.c
patch
|
blob
|
history
diff --git
a/libbb/compare_string_array.c
b/libbb/compare_string_array.c
index e0d8e421b568498bf38474485742ff0c8982cfea..3dbd3eb1af5b2be47187d01efb2e77c966f3ad2a 100644
(file)
--- a/
libbb/compare_string_array.c
+++ b/
libbb/compare_string_array.c
@@
-39,8
+39,9
@@
char* FAST_FUNC is_suffixed_with(const char *string, const char *key)
ssize_t len_diff = strlen(string) - key_len;
if (len_diff >= 0) {
- if (strcmp(string + len_diff, key) == 0) {
- return (char*)key;
+ string += len_diff;
+ if (strcmp(string, key) == 0) {
+ return (char*)string;
}
}