]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
cope better with unusual compiler options
authorAndrew Tridgell <tridge@samba.org>
Thu, 28 Mar 2002 06:21:20 +0000 (07:21 +0100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 28 Mar 2002 06:21:20 +0000 (07:21 +0100)
ccache.c

index 60fec413c62fe917d154d1657d87164ffedc9fc3..fa632e46426e9136db874c47622b362b7c0d4a3d 100644 (file)
--- 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]);