char buf[2048];
static void source(char *src){    char buf[2048];    unsigned long size;    char *last;    HANDLE f;    DWORD attr;    unsigned long i;    unsigned long stat_bytes;    time_t stat_starttime, stat_lasttime;    attr = GetFileAttributes(src);    if (attr == (DWORD) - 1) {	run_err("%s: No such file or directory", src);	return;    }    if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {	if (recursive) {	    /*	     * Avoid . and .. directories.	     */	    char *p;	    p = strrchr(src, '/');	    if (!p)		p = strrchr(src, '\\');	    if (!p)		p = src;	    else		p++;	    if (!strcmp(p, ".") || !strcmp(p, ".."))		/* skip . and .. */ ;	    else		rsource(src);	} else {	    run_err("%s: not a regular file", src);	}	return;    }    if ((last = strrchr(src, '/')) == NULL)	last = src;    else	last++;    if (strrchr(last, '\\') != NULL)	last = strrchr(last, '\\') + 1;    if (last == src && strchr(src, ':') != NULL)	last = strchr(src, ':') + 1;    f = CreateFile(src, GENERIC_READ, FILE_SHARE_READ, NULL,		   OPEN_EXISTING, 0, 0);    if (f == INVALID_HANDLE_VALUE) {	run_err("%s: Cannot open file", src);	return;    }    if (preserve) {	FILETIME actime, wrtime;	unsigned long mtime, atime;	GetFileTime(f, NULL, &actime, &wrtime);	TIME_WIN_TO_POSIX(actime, atime);	TIME_WIN_TO_POSIX(wrtime, mtime);	if (scp_send_filetimes(mtime, atime))	    return;    }    size = GetFileSize(f, NULL);    if (verbose)	tell_user(stderr, "Sending file %s, size=%lu", last, size);    if (scp_send_filename(last, size, 0644))	return;    stat_bytes = 0;    stat_starttime = time(NULL);    stat_lasttime = 0;    for (i = 0; i < size; i += 4096) {	char transbuf[4096];	DWORD j, k = 4096;	if (i + k > size)	    k = size - i;	if (!ReadFile(f, transbuf, k, &j, NULL) || j != k) {	    if (statistics)		printf("\n");	    bump("%s: Read error", src);	}	if (scp_send_filedata(transbuf, k))	    bump("%s: Network error occurred", src);	if (statistics) {	    stat_bytes += k;	    if (time(NULL) != stat_lasttime || i + k == size) {		stat_lasttime = time(NULL);		print_stats(last, size, stat_bytes,			    stat_starttime, stat_lasttime);	    }	}    }    CloseHandle(f);    (void) scp_send_finish();}