Diff

Differences From Artifact [5868f73f67]:

To Artifact [47404c0424]:


42
43
44
45
46
47
48

49
50
51
52
53
54
55
#define   WM_STATS_CHAR		( WM_APP_BASE+402 )
#define   WM_STATS_SIZE 	( WM_APP_BASE+403 )
#define   WM_STATS_PERCENT	( WM_APP_BASE+404 )
#define   WM_STATS_ELAPSED	( WM_APP_BASE+405 )
#define   WM_RET_ERR_CNT	( WM_APP_BASE+406 )
#define   WM_LS_RET_ERR_CNT	( WM_APP_BASE+407 )


static int verbose = 0;
static int recursive = 0;
static int preserve = 0;
static int targetshouldbedirectory = 0;
static int statistics = 1;
static int portnumber = 0;
static char *password = NULL;







>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#define   WM_STATS_CHAR		( WM_APP_BASE+402 )
#define   WM_STATS_SIZE 	( WM_APP_BASE+403 )
#define   WM_STATS_PERCENT	( WM_APP_BASE+404 )
#define   WM_STATS_ELAPSED	( WM_APP_BASE+405 )
#define   WM_RET_ERR_CNT	( WM_APP_BASE+406 )
#define   WM_LS_RET_ERR_CNT	( WM_APP_BASE+407 )

static int list = 0;
static int verbose = 0;
static int recursive = 0;
static int preserve = 0;
static int targetshouldbedirectory = 0;
static int statistics = 1;
static int portnumber = 0;
static char *password = NULL;
235
236
237
238
239
240
241










242
243
244
245
246
247
248
249
250
251
252
253
254










255
256
257
258
259
260
261
    va_list ap;
    va_start(ap, fmt);
    strcpy(str, "Fatal:");
    vsprintf(str + strlen(str), fmt, ap);
    va_end(ap);
    strcat(str, "\n");
    tell_str(stderr, str);











    exit(1);
}
void connection_fatal(char *fmt, ...)
{
    char str[0x100];		       /* Make the size big enough */
    va_list ap;
    va_start(ap, fmt);
    strcpy(str, "Fatal:");
    vsprintf(str + strlen(str), fmt, ap);
    va_end(ap);
    strcat(str, "\n");
    tell_str(stderr, str);











    exit(1);
}

/*
 * Be told what socket we're supposed to be using.
 */







>
>
>
>
>
>
>
>
>
>













>
>
>
>
>
>
>
>
>
>







236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
    va_list ap;
    va_start(ap, fmt);
    strcpy(str, "Fatal:");
    vsprintf(str + strlen(str), fmt, ap);
    va_end(ap);
    strcat(str, "\n");
    tell_str(stderr, str);
    errs++;

    if (gui_mode) {
	unsigned int msg_id = WM_RET_ERR_CNT;
	if (list)
	    msg_id = WM_LS_RET_ERR_CNT;
	while (!PostMessage
	       ((HWND) atoi(gui_hwnd), msg_id, (WPARAM) errs,
		0 /*lParam */ ))SleepEx(1000, TRUE);
    }

    exit(1);
}
void connection_fatal(char *fmt, ...)
{
    char str[0x100];		       /* Make the size big enough */
    va_list ap;
    va_start(ap, fmt);
    strcpy(str, "Fatal:");
    vsprintf(str + strlen(str), fmt, ap);
    va_end(ap);
    strcat(str, "\n");
    tell_str(stderr, str);
    errs++;

    if (gui_mode) {
	unsigned int msg_id = WM_RET_ERR_CNT;
	if (list)
	    msg_id = WM_LS_RET_ERR_CNT;
	while (!PostMessage
	       ((HWND) atoi(gui_hwnd), msg_id, (WPARAM) errs,
		0 /*lParam */ ))SleepEx(1000, TRUE);
    }

    exit(1);
}

/*
 * Be told what socket we're supposed to be using.
 */
394
395
396
397
398
399
400

401
402
403
404
405
406










407
408
409
410
411
412
413
    va_list ap;
    va_start(ap, fmt);
    strcpy(str, "Fatal:");
    vsprintf(str + strlen(str), fmt, ap);
    va_end(ap);
    strcat(str, "\n");
    tell_str(stderr, str);


    if (back != NULL && back->socket() != NULL) {
	char ch;
	back->special(TS_EOF);
	ssh_scp_recv(&ch, 1);
    }










    exit(1);
}

static int get_line(const char *prompt, char *str, int maxlen, int is_pw)
{
    HANDLE hin, hout;
    DWORD savemode, newmode, i;







>






>
>
>
>
>
>
>
>
>
>







415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
    va_list ap;
    va_start(ap, fmt);
    strcpy(str, "Fatal:");
    vsprintf(str + strlen(str), fmt, ap);
    va_end(ap);
    strcat(str, "\n");
    tell_str(stderr, str);
    errs++;

    if (back != NULL && back->socket() != NULL) {
	char ch;
	back->special(TS_EOF);
	ssh_scp_recv(&ch, 1);
    }

    if (gui_mode) {
	unsigned int msg_id = WM_RET_ERR_CNT;
	if (list)
	    msg_id = WM_LS_RET_ERR_CNT;
	while (!PostMessage
	       ((HWND) atoi(gui_hwnd), msg_id, (WPARAM) errs,
		0 /*lParam */ ))SleepEx(1000, TRUE);
    }

    exit(1);
}

static int get_line(const char *prompt, char *str, int maxlen, int is_pw)
{
    HANDLE hin, hout;
    DWORD savemode, newmode, i;
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246

/*
 *  Main program (no, really?)
 */
int main(int argc, char *argv[])
{
    int i;
    int list = 0;

    default_protocol = PROT_TELNET;

    flags = FLAG_STDERR;
    ssh_get_line = &get_line;
    init_winsock();
    sk_init();







<







1264
1265
1266
1267
1268
1269
1270

1271
1272
1273
1274
1275
1276
1277

/*
 *  Main program (no, really?)
 */
int main(int argc, char *argv[])
{
    int i;


    default_protocol = PROT_TELNET;

    flags = FLAG_STDERR;
    ssh_get_line = &get_line;
    init_winsock();
    sk_init();