sh: Reindent expandmeta().
This commit is contained in:
parent
0e39c931e2
commit
ee97d8648c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292995
@ -1028,28 +1028,28 @@ expandmeta(char *pattern, struct arglist *dstlist)
|
|||||||
int firstmatch;
|
int firstmatch;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
firstmatch = dstlist->count;
|
firstmatch = dstlist->count;
|
||||||
p = pattern;
|
p = pattern;
|
||||||
for (; (c = *p) != '\0'; p++) {
|
for (; (c = *p) != '\0'; p++) {
|
||||||
/* fast check for meta chars */
|
/* fast check for meta chars */
|
||||||
if (c == '*' || c == '?' || c == '[') {
|
if (c == '*' || c == '?' || c == '[') {
|
||||||
INTOFF;
|
INTOFF;
|
||||||
expmeta(expdir, pattern, dstlist);
|
expmeta(expdir, pattern, dstlist);
|
||||||
INTON;
|
INTON;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dstlist->count == firstmatch) {
|
|
||||||
/*
|
|
||||||
* no matches
|
|
||||||
*/
|
|
||||||
rmescapes(pattern);
|
|
||||||
appendarglist(dstlist, pattern);
|
|
||||||
} else {
|
|
||||||
qsort(&dstlist->args[firstmatch],
|
|
||||||
dstlist->count - firstmatch,
|
|
||||||
sizeof(dstlist->args[0]), expsortcmp);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (dstlist->count == firstmatch) {
|
||||||
|
/*
|
||||||
|
* no matches
|
||||||
|
*/
|
||||||
|
rmescapes(pattern);
|
||||||
|
appendarglist(dstlist, pattern);
|
||||||
|
} else {
|
||||||
|
qsort(&dstlist->args[firstmatch],
|
||||||
|
dstlist->count - firstmatch,
|
||||||
|
sizeof(dstlist->args[0]), expsortcmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user