using #[num] with -o now make it literally used if there's no globbing for
that particular index. Reported in bug report 997536.
This commit is contained in:
parent
ad63e1e698
commit
8e7fcd9ee1
@ -449,10 +449,9 @@ char *glob_match_url(char *filename, URLGlob *glob)
|
|||||||
|
|
||||||
while (*filename) {
|
while (*filename) {
|
||||||
if (*filename == '#' && isdigit((int)filename[1])) {
|
if (*filename == '#' && isdigit((int)filename[1])) {
|
||||||
/* only '#1' ... '#9' allowed */
|
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
|
char *ptr = filename;
|
||||||
unsigned long num = strtoul(&filename[1], &filename, 10);
|
unsigned long num = strtoul(&filename[1], &filename, 10);
|
||||||
|
|
||||||
i = num-1;
|
i = num-1;
|
||||||
|
|
||||||
if (num && (i <= glob->size / 2)) {
|
if (num && (i <= glob->size / 2)) {
|
||||||
@ -482,6 +481,12 @@ char *glob_match_url(char *filename, URLGlob *glob)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* #[num] out of range, use the #[num] in the output */
|
||||||
|
filename = ptr;
|
||||||
|
appendthis=filename++;
|
||||||
|
appendlen=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
appendthis=filename++;
|
appendthis=filename++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user