From: Joel Rosdahl Date: Sun, 12 Dec 2021 20:12:22 +0000 (+0100) Subject: refactor: Move conversion to slash option outside file test X-Git-Tag: v4.6~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15e315eb805d504fd1645658839aa061a56d0c7a;p=thirdparty%2Fccache.git refactor: Move conversion to slash option outside file test --- diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index b78b16f57..0e2898e51 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -935,15 +935,17 @@ process_arg(const Context& ctx, return nullopt; } + // It was not a known option. + if (changed_from_slash) { + args[i][0] = '/'; + } + // If an argument isn't a plain file then assume its an option, not an input // file. This allows us to cope better with unusual compiler options. // // Note that "/dev/null" is an exception that is sometimes used as an input // file when code is testing compiler flags. if (args[i] != "/dev/null") { - if (changed_from_slash) { - args[i][0] = '/'; - } auto st = Stat::stat(args[i]); if (!st || !st.is_regular()) { LOG("{} is not a regular file, not considering as input file", args[i]);