]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
handle -S with -c (it changes the default extension)
authorAndrew Tridgell <tridge@samba.org>
Wed, 27 Mar 2002 04:53:05 +0000 (05:53 +0100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 27 Mar 2002 04:53:05 +0000 (05:53 +0100)
ccache.c

index 231228100f2d27ec33fe6830684311d7c3eb5e2a..c250640ee47f6e58b906fdf3e7e319be946f551a 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -331,6 +331,7 @@ static void process_args(int argc, char **argv)
 {
        int i;
        int found_c_opt = 0;
+       int found_S_opt = 0;
        char *input_file = NULL;
 
        stripped_args = args_init();
@@ -349,6 +350,13 @@ static void process_args(int argc, char **argv)
                        found_c_opt = 1;
                        continue;
                }
+
+               /* -S changes the default extension */
+               if (strcmp(argv[i], "-S") == 0) {
+                       args_add(stripped_args, argv[i]);
+                       found_S_opt = 1;
+                       continue;
+               }
                
                /* we need to work out where the output was meant to go */
                if (strcmp(argv[i], "-o") == 0) {
@@ -426,7 +434,7 @@ static void process_args(int argc, char **argv)
                        cc_log("badly formed output_file %s\n", output_file);
                        failed();
                }
-               p[1] = 'o';
+               p[1] = found_S_opt ? 's' : 'o';
                p[2] = 0;
 #if 0
                cc_log("Formed output file %s from input_file %s\n",