summaryrefslogtreecommitdiff
path: root/libc/posix/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/posix/glob.c')
-rw-r--r--libc/posix/glob.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/posix/glob.c b/libc/posix/glob.c
index b1bd3e4cc..017180a27 100644
--- a/libc/posix/glob.c
+++ b/libc/posix/glob.c
@@ -439,6 +439,8 @@ glob (pattern, flags, errfunc, pglob)
}
}
+ oldcount = pglob->gl_pathc + pglob->gl_offs;
+
/* Find the filename. */
filename = strrchr (pattern, '/');
#if defined __MSDOS__ || defined WINDOWS32
@@ -556,8 +558,6 @@ glob (pattern, flags, errfunc, pglob)
}
}
- oldcount = pglob->gl_pathc + pglob->gl_offs;
-
#ifndef VMS
if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
@@ -1047,9 +1047,9 @@ glob (pattern, flags, errfunc, pglob)
: (__stat64 (pglob->gl_pathv[i], &st64) == 0
&& S_ISDIR (st64.st_mode))))
{
- size_t len = strlen (pglob->gl_pathv[i]) + 2;
+ size_t len = strlen (pglob->gl_pathv[i]) + 2;
char *new = realloc (pglob->gl_pathv[i], len);
- if (new == NULL)
+ if (new == NULL)
{
globfree (pglob);
pglob->gl_pathc = 0;