From c9d9966c7dedfb00ac139170c6d1cce7d198ca31 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Thu, 11 Jan 2018 20:51:38 +0100 Subject: [PATCH] Don't skip compiler argument following AFFECTS_CPP without TAKES_ARG Bug found by Mike Gelfand. Fixes #203. --- ccache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ccache.c b/ccache.c index e30bb50f1..64b25def7 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])) { -- 2.47.2