while (ssh_scp_recv(&c, 1) > 0) tell_char(stdout, c);
if (using_sftp) { scp_sftp_listdir(src); } else { while (ssh_scp_recv(&c, 1) > 0) tell_char(stdout, c); }
static void get_dir_list(int argc, char *argv[]){    char *src, *host, *user;    char *cmd, *p, *q;    char c;    src = argv[0];    /* Separate host from filename */    host = src;    src = colon(src);    if (src == NULL)	bump("Local to local copy not supported");    *src++ = '\0';    if (*src == '\0')	src = ".";    /* Substitute "." for empty filename */    /* Separate username and hostname */    user = host;    host = strrchr(host, '@');    if (host == NULL) {	host = user;	user = NULL;    } else {	*host++ = '\0';	if (*user == '\0')	    user = NULL;    }    cmd = smalloc(4 * strlen(src) + 100);    strcpy(cmd, "ls -la '");    p = cmd + strlen(cmd);    for (q = src; *q; q++) {	if (*q == '\'') {	    *p++ = '\'';	    *p++ = '\\';	    *p++ = '\'';	    *p++ = '\'';	} else {	    *p++ = *q;	}    }    *p++ = '\'';    *p = '\0';    do_cmd(host, user, cmd);    sfree(cmd);    while (ssh_scp_recv(&c, 1) > 0)	tell_char(stdout, c);}