diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-05-24 13:55:39 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-05-24 13:55:39 +0200 |
| commit | 3c5124ce68110b780f9cd5aaa3801f1f200b98fe (patch) | |
| tree | 559b04d3abedb840b70903729a7f52563f24efe2 /src | |
| parent | a8d78660ee08d1e1e417c3b62b45b91499ac7fc9 (diff) | |
Fix `odin build examples\demo\` trailing slash handling.
Diffstat (limited to 'src')
| -rw-r--r-- | src/build_settings.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 8bc889635..b458d8308 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -1338,7 +1338,12 @@ bool init_build_paths(String init_filename) { } else { // Init filename was not 'current path'. // Contruct the output name from the path elements as usual. - String output_name = remove_directory_from_path(init_filename); + String output_name = init_filename; + // If it ends with a trailing (back)slash, strip it before continuing. + while (output_name.len > 0 && (output_name[output_name.len-1] == '/' || output_name[output_name.len-1] == '\\')) { + output_name.len -= 1; + } + output_name = remove_directory_from_path(output_name); output_name = remove_extension_from_path(output_name); output_name = copy_string(ha, string_trim_whitespace(output_name)); output_path = path_from_string(ha, output_name); |