From: Andrew Tridgell Date: Thu, 28 Mar 2002 06:21:20 +0000 (+0100) Subject: cope better with unusual compiler options X-Git-Tag: v1.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=221cdbefb124a37fcb5db34e8a696fbabf48cbac;p=thirdparty%2Fccache.git cope better with unusual compiler options --- diff --git a/ccache.c b/ccache.c index 60fec413c..fa632e464 100644 --- a/ccache.c +++ b/ccache.c @@ -378,6 +378,7 @@ static void process_args(int argc, char **argv) int found_c_opt = 0; int found_S_opt = 0; char *input_file = NULL; + struct stat st; stripped_args = args_init(); @@ -449,6 +450,14 @@ static void process_args(int argc, char **argv) continue; } + /* 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 */ + if (stat(argv[i], &st) != 0 || !S_ISREG(st.st_mode)) { + args_add(stripped_args, argv[i]); + continue; + } + if (input_file) { cc_log("multiple input files (%s and %s)\n", input_file, argv[i]);