sh: Reindent expandmeta().

This commit is contained in:
Jilles Tjoelker 2015-12-31 18:56:11 +00:00
parent 0e39c931e2
commit ee97d8648c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292995

View File

@ -1028,28 +1028,28 @@ expandmeta(char *pattern, struct arglist *dstlist)
int firstmatch;
char c;
firstmatch = dstlist->count;
p = pattern;
for (; (c = *p) != '\0'; p++) {
/* fast check for meta chars */
if (c == '*' || c == '?' || c == '[') {
INTOFF;
expmeta(expdir, pattern, dstlist);
INTON;
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);
firstmatch = dstlist->count;
p = pattern;
for (; (c = *p) != '\0'; p++) {
/* fast check for meta chars */
if (c == '*' || c == '?' || c == '[') {
INTOFF;
expmeta(expdir, pattern, dstlist);
INTON;
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);
}
}