SCP: Remove leading / from sim_dir_scan file names when glob isn't available

This commit is contained in:
Mark Pizzolato 2018-05-10 00:09:19 -07:00
parent 9d04c49641
commit c0cda9ffd4

3
scp.c
View file

@ -5917,10 +5917,11 @@ if (dir) {
if (fnmatch(MatchName, ent->d_name, 0)) if (fnmatch(MatchName, ent->d_name, 0))
continue; continue;
#else #else
/* only match exact name without fnmatch support */
if (strcmp(MatchName, ent->d_name) != 0) if (strcmp(MatchName, ent->d_name) != 0)
continue; continue;
#endif #endif
sprintf (FileName, "%s/%s", DirName, ent->d_name); sprintf (FileName, "%s%s", DirName, ent->d_name);
#endif #endif
p_name = FileName + strlen (DirName); p_name = FileName + strlen (DirName);
memset (&filestat, 0, sizeof (filestat)); memset (&filestat, 0, sizeof (filestat));