mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix bug when . is passed to remove_extension_from_path
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
Path handling utilities.
|
Path handling utilities.
|
||||||
*/
|
*/
|
||||||
gb_internal String remove_extension_from_path(String const &s) {
|
gb_internal String remove_extension_from_path(String const &s) {
|
||||||
|
if (s.len != 0 && s.text[s.len-1] == '.') {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
for (isize i = s.len-1; i >= 0; i--) {
|
for (isize i = s.len-1; i >= 0; i--) {
|
||||||
if (s[i] == '.') {
|
if (s[i] == '.') {
|
||||||
return substring(s, 0, i);
|
return substring(s, 0, i);
|
||||||
|
|||||||
Reference in New Issue
Block a user