]> sjero.net Git - wget/blobdiff - src/ftp-basic.c
[svn] Rewrite parsing and handling of URLs.
[wget] / src / ftp-basic.c
index ee17669058f0f9a6249ded23125e892dccc814bd..7d36bf267c6f4f3f1ae2a12972dd5a861a10bc4b 100644 (file)
@@ -633,6 +633,7 @@ ftp_pwd (struct rbuf *rbuf, char **pwd)
   /* All OK.  */
   return FTPOK;
 }
+
 /* Sends the SIZE command to the server, and returns the value in 'size'.
  * If an error occurs, size is set to zero. */
 uerr_t
@@ -690,3 +691,16 @@ ftp_size (struct rbuf *rbuf, const char *file, long int *size)
   /* All OK.  */
   return FTPOK;
 }
+
+/* If URL's params are of the form "type=X", return character X.
+   Otherwise, return 'I' (the default type).  */
+char
+ftp_process_type (const char *params)
+{
+  if (params
+      && 0 == strncasecmp (params, "type=", 5)
+      && params[5] != '\0')
+    return TOUPPER (params[5]);
+  else
+    return 'I';
+}