From: Joel Rosdahl Date: Sun, 8 Jan 2012 11:59:02 +0000 (+0100) Subject: Also recognize -specs=file in addition to --specs=file X-Git-Tag: v3.1.7~2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d329e0af9016e3828d98b369357dbb4a6d35725f;p=thirdparty%2Fccache.git Also recognize -specs=file in addition to --specs=file --- diff --git a/ccache.c b/ccache.c index b26591719..e41af1355 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; }