summaryrefslogtreecommitdiff
path: root/ccache.c
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2018-01-11 20:51:38 +0100
committerJoel Rosdahl <joel@rosdahl.net>2018-01-11 21:05:14 +0100
commitc9d9966c7dedfb00ac139170c6d1cce7d198ca31 (patch)
tree0e31962f5754ad57ec405c0bbbd35c77519a9654 /ccache.c
parentfac1597a7abbac7046926bc75dadcfa275aec01a (diff)
downloadccache-c9d9966c7dedfb00ac139170c6d1cce7d198ca31.tar.gz
Don't skip compiler argument following AFFECTS_CPP without TAKES_ARG
Bug found by Mike Gelfand. Fixes #203.
Diffstat (limited to 'ccache.c')
-rw-r--r--ccache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ccache.c b/ccache.c
index e30bb50f..64b25def 100644
--- 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])) {