From 2cd2f8c1d3f3c6c638637692bfb85fa44460e0bc Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 7 Jan 2018 16:54:39 -0800 Subject: [PATCH] SCP: Use explicit filename compare when built without HAVE_GLOB & HAVE_FNMATCH --- scp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 3a41321f..6a6dbc26 100644 --- a/scp.c +++ b/scp.c @@ -5575,9 +5575,7 @@ if (dir) { #endif t_offset FileSize; char FileName[PATH_MAX + 1]; -#if defined (HAVE_FNMATCH) char *MatchName = 1 + strrchr (cptr, '/');; -#endif char *p_name; struct tm *local; #if defined (HAVE_GLOB) @@ -5592,6 +5590,9 @@ if (dir) { #if defined (HAVE_FNMATCH) if (fnmatch(MatchName, ent->d_name, 0)) continue; +#else + if (strcmp(MatchName, ent->d_name) != 0) + continue; #endif sprintf (FileName, "%s/%s", DirName, ent->d_name); #endif