]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don't skip compiler argument following AFFECTS_CPP without TAKES_ARG
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 11 Jan 2018 19:51:38 +0000 (20:51 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 11 Jan 2018 20:05:14 +0000 (21:05 +0100)
Bug found by Mike Gelfand.

Fixes #203.

ccache.c

index e30bb50f1d1eafece13a695b715bae61db4defd9..64b25def7cf373380f0f704084000cf2f77e8d6e 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1673,7 +1673,9 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                if (!direct_mode && !output_is_precompiled_header
                    && !using_precompiled_header) {
                        if (compopt_affects_cpp(args->argv[i])) {
-                               i++;
+                               if (compopt_takes_arg(args->argv[i])) {
+                                       i++;
+                               }
                                continue;
                        }
                        if (compopt_short(compopt_affects_cpp, args->argv[i])) {