changeset 369:c63208a1f0f1

2003-1-18 Brian Masney <masneyb@gftp.org> * lib/misc.c (gftp_build_path) - when checking for already existing /'s, not only look at the end of the currently built string, but look at the beginning of the token that is about to be added (from Aurelien Jarno <aurel32@debian.org>) * lib/rfc2068.c (rfc2068_list_files) - if the current directory is /, just send the hostname over to the HTTP server. This was broken on some HTTP servers. (from Aurelien Jarno <aurel32@debian.org>)
author masneyb
date Sun, 18 Jan 2004 20:30:08 +0000
parents af541d789f4c
children f514f510ebaa
files ChangeLog lib/misc.c lib/rfc2068.c
diffstat 3 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 18 20:18:19 2004 +0000
+++ b/ChangeLog	Sun Jan 18 20:30:08 2004 +0000
@@ -1,4 +1,14 @@
 2003-1-18 Brian Masney <masneyb@gftp.org>
+	* lib/misc.c (gftp_build_path) - when checking for already existing
+	/'s, not only look at the end of the currently built string, but look
+	at the beginning of the token that is about to be added
+	(from Aurelien Jarno <aurel32@debian.org>)
+
+	* lib/rfc2068.c (rfc2068_list_files) - if the current directory is /,
+	just send the hostname over to the HTTP server. This was broken on some
+	HTTP servers.
+	(from Aurelien Jarno <aurel32@debian.org>)
+
 	* lib/gftp.h lib/misc.c src/gtk/delete_dialog.c src/gtk/transfer.c
 	src/gtk/view_dialog.c src/uicommon/gftpui.c - renamed all instances of
 	copy_request() to gftp_copy_request(). Removed second argument
@@ -2009,7 +2019,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.202 2004/01/18 20:18:17 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.203 2004/01/18 20:30:08 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/misc.c	Sun Jan 18 20:18:19 2004 +0000
+++ b/lib/misc.c	Sun Jan 18 20:30:08 2004 +0000
@@ -1194,7 +1194,7 @@
     {
       len = strlen (element);
 
-      if (retlen > 0 && ret[retlen - 1] == '/')
+      if (retlen > 0 && (ret[retlen - 1] == '/' || element[0] == '/'))
         add_separator = 0;
       else
         {
--- a/lib/rfc2068.c	Sun Jan 18 20:18:19 2004 +0000
+++ b/lib/rfc2068.c	Sun Jan 18 20:30:08 2004 +0000
@@ -414,7 +414,10 @@
   params = request->protocol_data;
   gftp_lookup_request_option (request, "use_http11", &use_http11);
 
-  hd = gftp_build_path (request->hostname, request->directory, NULL);
+  if (strncmp (request->directory, "/", strlen (request->directory)) == 0)
+    hd = g_strdup (request->hostname);
+  else
+    hd = gftp_build_path (request->hostname, request->directory, NULL);
 
   if (request->username == NULL || *request->username == '\0')
     tempstr = g_strconcat ("GET ", request->url_prefix, "://", hd,