mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-03 10:57:15 -04:00
Use name of source file as output_name
This commit is contained in:
1 parent
139fa55c27
commit
ae02e9c34a
2 files changed
+12
-2
No files matched your search
@@ -276,6 +276,15 @@ String filename_from_path(String s) {
|
||||
return make_string(nullptr, 0);
|
||||
}
|
||||
|
||||
String remove_extension_from_path(String const &s) {
|
||||
for (isize i = s.len-1; i >= 0; i--) {
|
||||
if (s[i] == '.') {
|
||||
return substring(s, 0, i);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
String remove_directory_from_path(String const &s) {
|
||||
isize len = 0;
|
||||
for (isize i = s.len-1; i >= 0; i--) {
|
||||
@@ -287,6 +296,7 @@ String remove_directory_from_path(String const &s) {
|
||||
}
|
||||
return substring(s, s.len-len, s.len);
|
||||
}
|
||||
|
||||
String directory_from_path(String const &s) {
|
||||
isize i = s.len-1;
|
||||
for (; i >= 0; i--) {
|
||||
|
||||
Reference in new issue
Block a user