-// Copyright (C) 2020-2024 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2025 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
// Potentially rewrite concatenated absolute path argument to relative.
if (arg[0] == '-') {
const auto [option, path] = util::split_option_with_concat_path(arg);
- if (path) {
- if (compopt_takes_concat_arg(option) && compopt_takes_path(option)) {
- const auto relpath = core::make_relative_path(ctx, *path);
- std::string new_option = FMT("{}{}", option, relpath);
- if (compopt_affects_cpp_output(option)) {
- state.cpp_args.push_back(std::move(new_option));
- } else {
- state.common_args.push_back(std::move(new_option));
- }
- return Statistic::none;
+ if (path && compopt_takes_concat_arg(option)
+ && compopt_takes_path(option)) {
+ const auto relpath = core::make_relative_path(ctx, *path);
+ std::string new_option = FMT("{}{}", option, relpath);
+ if (compopt_affects_cpp_output(option)) {
+ state.cpp_args.push_back(std::move(new_option));
+ } else {
+ state.common_args.push_back(std::move(new_option));
}
+ return Statistic::none;
}
}