summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2012-01-08 12:59:02 +0100
committerJoel Rosdahl <joel@rosdahl.net>2012-01-08 12:59:02 +0100
commitd329e0af9016e3828d98b369357dbb4a6d35725f (patch)
tree588b50abf4f35d7e0de602ceeb70bd15fd379548
parent41d9f24c7b7fad7f2c5c4c805d80516446bd3ffa (diff)
downloadccache-d329e0af9016e3828d98b369357dbb4a6d35725f.tar.gz
Also recognize -specs=file in addition to --specs=file
-rw-r--r--ccache.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ccache.c b/ccache.c
index b2659171..e41af135 100644
--- 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;
}