]> granicus.if.org Git - curl/commitdiff
The results for a list only directory should be sent to the callback
authorJames Housley <jim@thehousleys.net>
Tue, 26 Jun 2007 20:23:10 +0000 (20:23 +0000)
committerJames Housley <jim@thehousleys.net>
Tue, 26 Jun 2007 20:23:10 +0000 (20:23 +0000)
lib/ssh.c

index 7993e12d3c308e6462866cba691d214308145fed..7e42b22490120a882c8944acec56869692a4828b 100644 (file)
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1487,7 +1487,14 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
           filename[len] = '\0';
 
           if (data->set.ftp_list_only) {
-            infof(data, "%s\n", filename);
+            char *tmpLine;
+            
+            tmpLine = aprintf("%s\n", filename);
+            if (tmpLine == NULL) {
+              return CURLE_OUT_OF_MEMORY;
+            }
+            result = Curl_client_write(conn, CLIENTWRITE_BODY, tmpLine, 0);
+            Curl_safefree(tmpLine);
           }
           else {
             totalLen = 80 + len;