summaryrefslogtreecommitdiffstats
path: root/lib/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/glob.c')
-rw-r--r--lib/glob.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/glob.c b/lib/glob.c
index 32f7afdce8..8523bad9a7 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -406,6 +406,18 @@ static int glob_in_dir(const char *pattern, const char *directory,
}
return nfound == 0 ? GLOB_NOMATCH : 0;
}
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+void globfree(glob_t *pglob)
+{
+ if (pglob->gl_pathv != NULL) {
+ int i = pglob->gl_flags & GLOB_DOOFFS ? pglob->gl_offs : 0;
+ for (; i < pglob->gl_pathc; ++i)
+ if (pglob->gl_pathv[i] != NULL)
+ free((__ptr_t) pglob->gl_pathv[i]);
+ free((__ptr_t) pglob->gl_pathv);
+ }
+}
#endif /* CONFIG_GLOB */
#ifdef CONFIG_FAKE_GLOB
@@ -443,15 +455,3 @@ glob_t *pglob;
return 0;
}
#endif /* CONFIG_FAKE_GLOB */
-
-/* Free storage allocated in PGLOB by a previous `glob' call. */
-void globfree(glob_t *pglob)
-{
- if (pglob->gl_pathv != NULL) {
- int i = pglob->gl_flags & GLOB_DOOFFS ? pglob->gl_offs : 0;
- for (; i < pglob->gl_pathc; ++i)
- if (pglob->gl_pathv[i] != NULL)
- free((__ptr_t) pglob->gl_pathv[i]);
- free((__ptr_t) pglob->gl_pathv);
- }
-}