cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] Fixed some wildcard type problems

From: Pavel Raiskup <pavel_at_raiskup.cz>
Date: Fri, 14 May 2010 22:25:29 +0200

---
 include/curl/curl.h |    4 ++--
 lib/ftplistparser.c |   24 ++++++++----------------
 2 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/include/curl/curl.h b/include/curl/curl.h
index d59e01d..a2e26ba 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -231,7 +231,7 @@ struct curl_fileinfo {
   char *filename;
   curlfiletype filetype;
   time_t time;
-  int32_t perm;
+  unsigned int perm;
   int uid;
   int gid;
   curl_off_t size;
@@ -246,7 +246,7 @@ struct curl_fileinfo {
     char *target; /* pointer to the target filename of a symlink */
   } strings;
 
-  int32_t flags;
+  unsigned int flags;
 
   /* used internally */
   char * b_data;
diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c
index 9d42e8f..faf314f 100644
--- a/lib/ftplistparser.c
+++ b/lib/ftplistparser.c
@@ -465,7 +465,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
           }
         }
         else if(parser->item_length == 10) {
-          int32_t perm;
+          unsigned int perm;
           if(c != ' ') {
             PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
             return bufflen;
@@ -560,7 +560,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
             finfo->b_data[parser->item_offset + parser->item_length - 1] = 0;
             parser->offsets.group = parser->item_offset;
             parser->state.UNIX.main = PL_UNIX_SIZE;
-            parser->state.UNIX.sub.group = PL_UNIX_SIZE_PRESPACE;
+            parser->state.UNIX.sub.size = PL_UNIX_SIZE_PRESPACE;
             parser->item_offset = 0;
             parser->item_length = 0;
           }
@@ -624,7 +624,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
         case PL_UNIX_TIME_PART1:
           parser->item_length++;
           if(c == ' ') {
-            parser->state.UNIX.sub.size = PL_UNIX_TIME_PREPART2;
+            parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART2;
           }
           else if(!ISALNUM(c) && c != '.') {
             PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
@@ -646,7 +646,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
         case PL_UNIX_TIME_PART2:
           parser->item_length++;
           if(c == ' ') {
-            parser->state.UNIX.sub.size = PL_UNIX_TIME_PREPART3;
+            parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART3;
           }
           else if(!ISALNUM(c) && c != '.') {
             PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
@@ -917,21 +917,13 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
               finfo->size = curlx_strtoofft(finfo->b_data + parser->item_offset,
                                             &endptr, 10);
               if(!*endptr) {
-                if(finfo->size < CURL_LLONG_MAX &&
-                   finfo->size > CURL_LLONG_MIN) {
-
-                }
-                else if(finfo->size == CURL_LLONG_MAX ||
-                        finfo->size == CURL_LLONG_MIN) {
+                if(finfo->size == CURL_LLONG_MAX ||
+                   finfo->size == CURL_LLONG_MIN) {
                   if(errno == ERANGE) {
                     PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
                     return bufflen;
                   }
                 }
-                else {
-                  PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
-                  return bufflen;
-                }
               }
               else {
                 PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
@@ -974,7 +966,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
               return bufflen;
             }
             parser->state.NT.main = PL_WINNT_DATE;
-            parser->state.NT.sub.filename = 0;
+            parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE;
           }
           break;
         case PL_WINNT_FILENAME_WINEOL:
@@ -986,7 +978,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
               return bufflen;
             }
             parser->state.NT.main = PL_WINNT_DATE;
-            parser->state.NT.sub.filename = 0;
+            parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE;
           }
           else {
             PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
-- 
1.7.1
------------Rf0QG2AvmlmcDaqNsgtNPg
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
------------Rf0QG2AvmlmcDaqNsgtNPg--
Received on 2001-09-17