From 7ee9051a56ca0c04e6b60f53b9dfe47c75596496 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 27 May 2018 10:49:14 +0100 Subject: IR now builds with the new package system --- src/string.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/string.cpp') diff --git a/src/string.cpp b/src/string.cpp index b63de5c76..32d97184a 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -259,7 +259,10 @@ bool string_contains_char(String const &s, u8 c) { String filename_from_path(String s) { isize i = string_extension_position(s); - s = substring(s, 0, i); + if (i >= 0) { + s = substring(s, 0, i); + return s; + } if (i > 0) { isize j = 0; for (j = s.len-1; j >= 0; j--) { -- cgit v1.2.3