From 825ec8ee3e5f5929f549ba0f9efcafcebcdac08e Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 5 Sep 2001 19:33:12 +0000 Subject: [PATCH] When pscp in SFTP mode does client-side matching of a server-side wildcard, it's polite to let the user know if the wildcard didn't match any file names. git-svn-id: svn://svn.tartarus.org/sgt/putty@1227 cda61777-01e9-0310-a592-d414129be87e --- scp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scp.c b/scp.c index f92485db..faf60ea4 100644 --- a/scp.c +++ b/scp.c @@ -841,6 +841,7 @@ static struct scp_sftp_dirstack { int namepos, namelen; char *dirpath; char *wildcard; + int matched_something; /* wildcard match set was non-empty */ } *scp_sftp_dirstack_head; static char *scp_sftp_remotepath, *scp_sftp_currentname; static char *scp_sftp_wildcard; @@ -1201,6 +1202,7 @@ int scp_get_sink_action(struct scp_sink_action *act) head->names[head->namepos].filename)))) head->namepos++; /* skip . and .. */ if (head->namepos < head->namelen) { + head->matched_something = 1; fname = dupcat(head->dirpath, "/", head->names[head->namepos++].filename, NULL); @@ -1213,7 +1215,13 @@ int scp_get_sink_action(struct scp_sink_action *act) */ if (head->wildcard) { act->action = SCP_SINK_RETRY; + if (!head->matched_something) { + tell_user(stderr, "pscp: wildcard '%s' matched " + "no files", head->wildcard); + errs++; + } sfree(head->wildcard); + } else { act->action = SCP_SINK_ENDDIR; } @@ -1334,6 +1342,7 @@ int scp_get_sink_action(struct scp_sink_action *act) newitem->dirpath = dupstr(fname); if (scp_sftp_wildcard) { newitem->wildcard = scp_sftp_wildcard; + newitem->matched_something = 0; scp_sftp_wildcard = NULL; } else { newitem->wildcard = NULL; -- 2.11.0