changeset 59:618423504fe0

2002-11-20 Brian Masney <masneyb@gftp.org> * lib/config_file.c - don't check buf[-1] for blank newlines in gftp_read_config_file() and gftp_read_bookmarks_file() * lib/misc.c (string_hash_function) - Fixes if the string was less than 2 characters * src/gtk/transfer.c - unlock mutex before we destroy (for POSIX compliance) All 3 of these fixes are from Peter Osterlund <petero2@telia.com>
author masneyb
date Thu, 21 Nov 2002 02:49:06 +0000
parents c01d91c10f6c
children 8a9324fb63a4
files ChangeLog lib/config_file.c lib/misc.c src/gtk/transfer.c
diffstat 4 files changed, 24 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Nov 21 00:33:51 2002 +0000
+++ b/ChangeLog	Thu Nov 21 02:49:06 2002 +0000
@@ -1,3 +1,15 @@
+2002-11-20 Brian Masney <masneyb@gftp.org>
+	* lib/config_file.c - don't check buf[-1] for blank newlines in 
+	gftp_read_config_file() and gftp_read_bookmarks_file() 
+
+	* lib/misc.c (string_hash_function) - Fixes if the string was less 
+	than 2 characters
+
+	* src/gtk/transfer.c - unlock mutex before we destroy (for POSIX
+	compliance)
+
+	All 3 of these fixes are from Peter Osterlund <petero2@telia.com>
+
 2002-11-20 Brian Masney <masneyb@gftp.org>
 	* lib/protocols.c lib/gftp.h - added gftp_get_line(), gftp_read(), 
 	gftp_write(), gftp_writefmt(), and gftp_set_sockblocking() functions. 
@@ -240,7 +252,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.33 2002/11/21 00:33:49 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.34 2002/11/21 02:49:05 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/config_file.c	Thu Nov 21 00:33:51 2002 +0000
+++ b/lib/config_file.c	Thu Nov 21 02:49:06 2002 +0000
@@ -288,7 +288,7 @@
       len = strlen (buf);
       if (buf[len - 1] == '\n')
 	buf[--len] = '\0';
-      if (buf[len - 1] == '\r')
+      if (len && buf[len - 1] == '\r')
 	buf[--len] = '\0';
       line++;
 
@@ -566,7 +566,7 @@
      len = strlen (buf);
       if (buf[len - 1] == '\n')
 	buf[--len] = '\0';
-      if (buf[len - 1] == '\r')
+      if (len && buf[len - 1] == '\r')
 	buf[--len] = '\0';
       line++;
 
--- a/lib/misc.c	Thu Nov 21 00:33:51 2002 +0000
+++ b/lib/misc.c	Thu Nov 21 02:49:06 2002 +0000
@@ -414,7 +414,14 @@
 guint
 string_hash_function (gconstpointer key)
 {
-  return (((char *) key)[0] + ((char *) key)[1] + ((char *) key)[2]);
+  guint ret;
+  int i;
+
+  ret = 0;
+  for (i=0; ((char *) key)[0] != '\0' && i < 3; i++)
+    ret += ((char *) key)[i];
+
+  return (ret);
 }
 
 
--- a/src/gtk/transfer.c	Thu Nov 21 00:33:51 2002 +0000
+++ b/src/gtk/transfer.c	Thu Nov 21 02:49:06 2002 +0000
@@ -1616,6 +1616,7 @@
 	  else if (tdata->done)
 	    {
 	      next = templist->next;
+              pthread_mutex_unlock (tdata->structmutex);
 	      transfer_done (templist);
 	      templist = next;
 	      continue;