]> sjero.net Git - wget/commitdiff
[svn] Add support for OS/400 ftp server.
authorhniksic <devnull@localhost>
Thu, 18 Sep 2003 13:46:17 +0000 (06:46 -0700)
committerhniksic <devnull@localhost>
Thu, 18 Sep 2003 13:46:17 +0000 (06:46 -0700)
src/ChangeLog
src/ftp-basic.c
src/ftp.c
src/ftp.h

index 094aa5ea5ae2a3683c298dedf1bc3358a48fc776..33e1cbe65564b1f8b012500465d585e2cf48e589 100644 (file)
@@ -1,3 +1,10 @@
+2003-09-17  Aurelien Marchand  <artaxerxes@users.sf.net>
+
+       * ftp.h: Added OS400 system in enum
+       * ftp-basic.c: recognize OS400 systems
+       * ftp.c: don't prepend the CWD if talking to OS400, since it
+       breaks the change in library
+
 2003-09-18  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * retr.c (get_contents): Pass the correct argument to ssl_iread.
index 5ba09527e9ac7ba4744f09a83d0d6370db03f697..512b2b312f59e3ea0a8ae802be7f294e9c67b40d 100644 (file)
@@ -768,6 +768,8 @@ ftp_syst (struct rbuf *rbuf, enum stype *server_type)
     *server_type = ST_WINNT;
   else if (!strcasecmp (request, "MACOS"))
     *server_type = ST_MACOS;
+  else if (!strcasecmp (request, "OS/400"))
+    *server_type = ST_OS400;
   else
     *server_type = ST_OTHER;
 
index 966b90b56faa3227a3e54dbdf106ffedfcbba9cd..5c619be141fc4f4a2b12067dd900657541d8d5aa 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -397,11 +397,19 @@ Error in server response, closing control connection.\n"));
 
             A relative directory is one that does not begin with '/'
             and, on non-Unix OS'es, one that doesn't begin with
-            "<letter>:".  */
+            "[a-z]:".
+
+            This is not done for OS400, which doesn't use
+            "/"-delimited directories, nor does it support directory
+            hierarchies.  "CWD foo" followed by "CWD bar" leaves us
+            in "bar", not in "foo/bar", as would be customary
+            elsewhere.  */
 
          if (target[0] != '/'
              && !(con->rs != ST_UNIX
-                  && ISALPHA (target[0]) && target[1] == ':'))
+                  && ISALPHA (target[0])
+                  && target[1] == ':')
+             && con->rs != ST_OS400)
            {
              int idlen = strlen (con->id);
              char *ntarget, *p;
index ad49cc82b6045f2fc9d826440477beba96ad7dcc..a5e73927f1aac2f19f5af86770389e3732d0d33a 100644 (file)
--- a/src/ftp.h
+++ b/src/ftp.h
@@ -42,6 +42,7 @@ enum stype
   ST_VMS,
   ST_WINNT,
   ST_MACOS,
+  ST_OS400,
   ST_OTHER
 };