FIO: Fix name matching when glob isn't available and using fnmatch
This commit is contained in:
parent
21117a2cb1
commit
4f215963f8
1 changed files with 5 additions and 1 deletions
|
@ -975,16 +975,20 @@ DIR *dir;
|
||||||
int found_count = 0;
|
int found_count = 0;
|
||||||
struct stat filestat;
|
struct stat filestat;
|
||||||
char *c;
|
char *c;
|
||||||
char DirName[PATH_MAX + 1], WholeName[PATH_MAX + 1], WildName[PATH_MAX + 1];
|
char DirName[PATH_MAX + 1], WholeName[PATH_MAX + 1], WildName[PATH_MAX + 1], MatchName[PATH_MAX + 1];
|
||||||
|
|
||||||
memset (DirName, 0, sizeof(DirName));
|
memset (DirName, 0, sizeof(DirName));
|
||||||
memset (WholeName, 0, sizeof(WholeName));
|
memset (WholeName, 0, sizeof(WholeName));
|
||||||
|
memset (MatchName, 0, sizeof(MatchName));
|
||||||
strlcpy (WildName, cptr, sizeof(WildName));
|
strlcpy (WildName, cptr, sizeof(WildName));
|
||||||
cptr = WildName;
|
cptr = WildName;
|
||||||
sim_trim_endspc (WildName);
|
sim_trim_endspc (WildName);
|
||||||
c = sim_filepath_parts (cptr, "f");
|
c = sim_filepath_parts (cptr, "f");
|
||||||
strlcpy (WholeName, c, sizeof (WholeName));
|
strlcpy (WholeName, c, sizeof (WholeName));
|
||||||
free (c);
|
free (c);
|
||||||
|
c = sim_filepath_parts (cptr, "nx");
|
||||||
|
strlcpy (MatchName, c, sizeof (MatchName));
|
||||||
|
free (c);
|
||||||
c = strrchr (WholeName, '/');
|
c = strrchr (WholeName, '/');
|
||||||
if (c) {
|
if (c) {
|
||||||
memmove (DirName, WholeName, 1+c-WholeName);
|
memmove (DirName, WholeName, 1+c-WholeName);
|
||||||
|
|
Loading…
Add table
Reference in a new issue