globdirlen = len;
}
- if (dir[dirlen - 1] == '/')
- sprintf(globdir, "%s*", dir);
- else
- sprintf(globdir, "%s/*", dir);
+ sprintf(globdir, "%s/*", dir);
if (!glob(globdir, GLOB_NOESCAPE | GLOB_MARK | GLOB_ONLYDIR, NULL, &gl))
for (j = 0; j < gl.gl_pathc; j++) {