glob should handle paths like /foo/bar//* so we probably don't need this
extra check & code.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
- 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++) {
if (!glob(globdir, GLOB_NOESCAPE | GLOB_MARK | GLOB_ONLYDIR, NULL, &gl))
for (j = 0; j < gl.gl_pathc; j++) {