mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-09 06:12:05 -04:00
Recognize dynamic library names like libraylib.so.5.0.0
This commit is contained in:
1 parent
1b143b9fa3
commit
60ef4fda4d
3 files changed
+21
-2
No files matched your search
@@ -323,6 +323,25 @@ gb_internal bool string_contains_char(String const &s, u8 c) {
|
||||
return false;
|
||||
}
|
||||
|
||||
gb_internal bool string_contains_string(String const &haystack, String const &needle) {
|
||||
if (needle.len == 0) return true;
|
||||
if (needle.len > haystack.len) return false;
|
||||
|
||||
for (isize i = 0; i <= haystack.len - needle.len; i++) {
|
||||
bool found = true;
|
||||
for (isize j = 0; j < needle.len; j++) {
|
||||
if (haystack[i + j] != needle[j]) {
|
||||
found = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
gb_internal String filename_from_path(String s) {
|
||||
isize i = string_extension_position(s);
|
||||
if (i >= 0) {
|
||||
|
||||
Reference in new issue
Block a user