projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the names of major contributors to the copyright statement. I've
[u/mdw/putty]
/
scp.c
diff --git
a/scp.c
b/scp.c
index
f92485d
..
aca1cf3
100644
(file)
--- a/
scp.c
+++ b/
scp.c
@@
-22,9
+22,6
@@
#include <limits.h>
#include <time.h>
#include <assert.h>
#include <limits.h>
#include <time.h>
#include <assert.h>
-/* GUI Adaptation - Sept 2000 */
-#include <winuser.h>
-#include <winbase.h>
#define PUTTY_DO_GLOBALS
#include "putty.h"
#define PUTTY_DO_GLOBALS
#include "putty.h"
@@
-652,7
+649,7
@@
static void print_stats(char *name, unsigned long size, unsigned long done,
sprintf(etastr, "%02ld:%02ld:%02ld",
eta / 3600, (eta % 3600) / 60, eta % 60);
sprintf(etastr, "%02ld:%02ld:%02ld",
eta / 3600, (eta % 3600) / 60, eta % 60);
- pct = (int) (100
.0 * (float) done / size
);
+ pct = (int) (100
* (done * 1.0 / size)
);
len = printf("\r%-25.25s | %10ld kB | %5.1f kB/s | ETA: %8s | %3d%%",
name, done / 1024, ratebs / 1024.0, etastr, pct);
len = printf("\r%-25.25s | %10ld kB | %5.1f kB/s | ETA: %8s | %3d%%",
name, done / 1024, ratebs / 1024.0, etastr, pct);
@@
-841,6
+838,7
@@
static struct scp_sftp_dirstack {
int namepos, namelen;
char *dirpath;
char *wildcard;
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;
} *scp_sftp_dirstack_head;
static char *scp_sftp_remotepath, *scp_sftp_currentname;
static char *scp_sftp_wildcard;
@@
-1201,6
+1199,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->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);
fname = dupcat(head->dirpath, "/",
head->names[head->namepos++].filename,
NULL);
@@
-1213,7
+1212,13
@@
int scp_get_sink_action(struct scp_sink_action *act)
*/
if (head->wildcard) {
act->action = SCP_SINK_RETRY;
*/
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);
sfree(head->wildcard);
+
} else {
act->action = SCP_SINK_ENDDIR;
}
} else {
act->action = SCP_SINK_ENDDIR;
}
@@
-1334,6
+1339,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->dirpath = dupstr(fname);
if (scp_sftp_wildcard) {
newitem->wildcard = scp_sftp_wildcard;
+ newitem->matched_something = 0;
scp_sftp_wildcard = NULL;
} else {
newitem->wildcard = NULL;
scp_sftp_wildcard = NULL;
} else {
newitem->wildcard = NULL;