diff src/gtk/dnd.c @ 518:c6a6e908dbaf

2004-7-27 Brian Masney <masneyb@gftp.org> * lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/sshv2.c src/gtk/bookmarks.c src/gtk/dnd.c src/gtk/gftp-gtk.c src/gtk/gtui.c src/gtk/menu-items.c src/misc-gtk.c src/gtk/options_dialog.c src/gtk/transfer.c src/text/gftp-text.c src/uicommon/gftpui.c - various fixes found through a static code analysis. (some signed/unsigned fixes, removed unneeded casts, indentation fixes, added static declaration to some functions)
author masneyb
date Wed, 28 Jul 2004 01:37:15 +0000
parents 39e9945288ea
children 7262851e3ae8
line wrap: on
line diff
--- a/src/gtk/dnd.c	Tue Jul 27 20:43:39 2004 +0000
+++ b/src/gtk/dnd.c	Wed Jul 28 01:37:15 2004 +0000
@@ -24,19 +24,19 @@
 static int
 dnd_remote_file (gftp_window_data * wdata, GList ** trans_list, char *url)
 {
-  gftp_window_data * other_wdata, * fromwdata;
   gftp_request * current_ftpdata;
+  gftp_window_data * fromwdata;
   gftp_transfer * tdata;
   gftp_file * newfle;
   GList * templist;
   char *pos;
 
   if (wdata == &window1)
-    other_wdata = &window2;
+    fromwdata = &window2;
   else if (wdata == &window2)
-    other_wdata = &window1;
+    fromwdata = &window1;
   else 
-    other_wdata = NULL;
+    fromwdata = NULL;
     
   newfle = g_malloc0 (sizeof (*newfle));
   newfle->shown = 1;
@@ -66,13 +66,11 @@
       return (0);
     }
 
-  if (other_wdata != NULL && 
-      compare_request (current_ftpdata, other_wdata->request, 0))
+  if (fromwdata != NULL && 
+      compare_request (current_ftpdata, fromwdata->request, 0))
     {
-      if (other_wdata->request->password != NULL)
-        gftp_set_password (current_ftpdata, other_wdata->request->password);
-
-      fromwdata = other_wdata;
+      if (fromwdata->request->password != NULL)
+        gftp_set_password (current_ftpdata, fromwdata->request->password);
     }
   else
     fromwdata = NULL;
@@ -83,6 +81,7 @@
   
   newfle->destfile = gftp_build_path (wdata->request->directory, pos, NULL);
 
+  tdata = NULL;
   for (templist = *trans_list; templist != NULL; templist = templist->next)
     {
       tdata = templist->data;
@@ -90,7 +89,7 @@
         break;
     }
 
-  if (templist == NULL)
+  if (templist == NULL || tdata == NULL)
     {
       tdata = gftp_tdata_new ();