}
if (*copyfrom == ')')
copyfrom++;
+ } else if (!elt[1]) {
+ /* Just ':' -- no element! */
+ return NULL;
} else {
/* shorthand */
for (copyfrom = elt + 1;
*copyfrom && *copyfrom != ':';
copyfrom++) {
char ch = *copyfrom;
+
+ if (!is_pathspec_magic(ch))
+ break;
for (i = 0; i < ARRAY_SIZE(pathspec_magic); i++)
if (pathspec_magic[i].mnemonic == ch) {
magic |= pathspec_magic[i].bit;
break;
}
if (ARRAY_SIZE(pathspec_magic) <= i)
- break;
+ die("Unimplemented pathspec magic '%c' in '%s'",
+ ch, elt);
}
if (*copyfrom == ':')
copyfrom++;