]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Also recognize -specs=file in addition to --specs=file
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 8 Jan 2012 11:59:02 +0000 (12:59 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 8 Jan 2012 11:59:02 +0000 (12:59 +0100)
ccache.c

index b26591719dfcfb59724ad1990b14ff776c62d0c6..e41af13557fa946f6397ecb71ba3f63260ab0e7a 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -902,6 +902,7 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
        struct stat st;
        int result;
        struct file_hash *object_hash = NULL;
+       char *p;
 
        /* first the arguments */
        for (i = 1; i < args->argc; i++) {
@@ -929,12 +930,17 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                        }
                }
 
-               if (str_startswith(args->argv[i], "--specs=")
-                   && stat(args->argv[i] + 8, &st) == 0) {
+               p = NULL;
+               if (str_startswith(args->argv[i], "-specs=")) {
+                       p = args->argv[i] + 7;
+               } else if (str_startswith(args->argv[i], "--specs=")) {
+                       p = args->argv[i] + 8;
+               }
+               if (p && stat(p, &st) == 0) {
                        /* If given an explicit specs file, then hash that file,
                           but don't include the path to it in the hash. */
                        hash_delimiter(hash, "specs");
-                       hash_compiler(hash, &st, args->argv[i] + 8, false);
+                       hash_compiler(hash, &st, p, false);
                        continue;
                }