| version 1.31, 2011/10/30 21:53:43 |
version 1.31.8.1, 2013/02/25 00:27:50 |
| Line 612 glob2(Char *pathbuf, Char *pathend, Char |
|
| Line 612 glob2(Char *pathbuf, Char *pathend, Char |
|
| const Char *p; |
const Char *p; |
| Char *q; |
Char *q; |
| int anymeta; |
int anymeta; |
| Char *pend; |
|
| ptrdiff_t diff; |
|
| |
|
| _DIAGASSERT(pathbuf != NULL); |
_DIAGASSERT(pathbuf != NULL); |
| _DIAGASSERT(pathend != NULL); |
_DIAGASSERT(pathend != NULL); |
| Line 665 glob2(Char *pathbuf, Char *pathend, Char |
|
| Line 663 glob2(Char *pathbuf, Char *pathend, Char |
|
| *q++ = *p++; |
*q++ = *p++; |
| } |
} |
| |
|
| /* |
if (!anymeta) { |
| * No expansion, or path ends in slash-dot shash-dot-dot, |
|
| * do next segment. |
|
| */ |
|
| if (pglob->gl_flags & GLOB_PERIOD) { |
|
| for (pend = pathend; pend > pathbuf && pend[-1] == '/'; |
|
| pend--) |
|
| continue; |
|
| diff = pend - pathbuf; |
|
| } else { |
|
| /* XXX: GCC */ |
|
| diff = 0; |
|
| pend = pathend; |
|
| } |
|
| |
|
| if ((!anymeta) || |
|
| ((pglob->gl_flags & GLOB_PERIOD) && |
|
| (diff >= 1 && pend[-1] == DOT) && |
|
| (diff >= 2 && (pend[-2] == SLASH || pend[-2] == DOT)) && |
|
| (diff < 3 || pend[-3] == SLASH))) { |
|
| pathend = q; |
pathend = q; |
| pattern = p; |
pattern = p; |
| while (*pattern == SEP) { |
while (*pattern == SEP) { |