Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
jobs:
build_windows:
name: Windows
runs-on: windows-2025
runs-on: windows-2022
strategy:
fail-fast: false
env:
Expand Down
10 changes: 10 additions & 0 deletions src/easymode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,17 @@ void easy_mode(int argc, char *argv[])
quit(EXIT_FAILURE);
}

#ifdef _WIN32
// Windows CommandLineToArgvW treats \" as a literal " rather than closing
// the argument, so a path typed as "C:\foo\bar\" arrives with a trailing "
// instead of \. Strip it so filesystem operations work correctly.
std::string path_arg = argv[optind];
if (!path_arg.empty() && path_arg.back() == '"')
path_arg.pop_back();
scan_easy(path_arg, preset ? preset : std::filesystem::path(), threads);
#else
scan_easy(argv[optind], preset ? preset : std::filesystem::path(), threads);
#endif
}

static bool convert_bool(const char *value, bool &setting)
Expand Down
10 changes: 10 additions & 0 deletions src/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ ScanJob* ScanJob::factory(char **files, size_t nb_files, const Config &config)
std::vector<Track> tracks;
std::unordered_set<FileType> types;
for (size_t i = 0; i < nb_files; i++) {
#ifdef _WIN32
// Windows CommandLineToArgvW treats \" as a literal " rather than closing
// the argument, so a path typed as "C:\foo\bar\" arrives with a trailing "
// instead of \. Strip it so filesystem operations work correctly.
std::string file_str = files[i];
if (!file_str.empty() && file_str.back() == '"')
file_str.pop_back();
path = file_str;
#else
path = files[i];
#endif
if (!std::filesystem::exists(path)) {
output_error("File '{}' does not exist", path.string());
return nullptr;
Expand Down