changeset 600:0a1d03fa2261

2004-11-1 Brian Masney <masneyb@gftp.org> * lib/config_file.c (gftp_read_config_file) - fixes for creating the protocol dropdown when SSL support is disabled (from Aurelien Jarno <aurelien@aurel32.net>)
author masneyb
date Mon, 01 Nov 2004 11:00:21 +0000
parents 0999b11f84e3
children 0e4ca3c8b9cf
files ChangeLog lib/config_file.c
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 29 20:16:40 2004 +0000
+++ b/ChangeLog	Mon Nov 01 11:00:21 2004 +0000
@@ -1,3 +1,8 @@
+2004-11-1 Brian Masney <masneyb@gftp.org>
+	* lib/config_file.c (gftp_read_config_file) - fixes for creating the
+	protocol dropdown when SSL support is disabled
+	(from Aurelien Jarno <aurelien@aurel32.net>)
+
 2004-10-29 Brian Masney <masneyb@gftp.org>
 	* lib/protocols.c (gftp_put_file) - don't do any kind of character
 	set conversion on the filename. After looking into this some more,
@@ -2971,7 +2976,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.349 2004/10/29 20:16:40 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.350 2004/11/01 11:00:21 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/config_file.c	Fri Oct 29 20:16:40 2004 +0000
+++ b/lib/config_file.c	Mon Nov 01 11:00:21 2004 +0000
@@ -534,7 +534,7 @@
   gftp_config_vars * tmpconfigvar;
   char **protocol_list;
   FILE *conffile;
-  int line, i;
+  int line, i, j;
   size_t len;
 
   gftp_global_options_htable = g_hash_table_new (string_hash_function, 
@@ -543,13 +543,14 @@
   gftp_register_config_vars (gftp_global_config_vars);
 
   protocol_list = NULL;
-  for (i=0; gftp_protocols[i].register_options != NULL; i++)
+  for (i=0, j=0; gftp_protocols[i].register_options != NULL; i++)
     {
       if (gftp_protocols[i].shown)
         {
-          protocol_list = g_realloc (protocol_list, sizeof (char *) * (i + 2));
-          protocol_list[i] = gftp_protocols[i].name;
-          protocol_list[i + 1] = NULL;
+          protocol_list = g_realloc (protocol_list, sizeof (char *) * (j + 2));
+          protocol_list[j] = gftp_protocols[i].name;
+          protocol_list[j + 1] = NULL;
+          j++;
         }
 
       if (gftp_protocols[i].register_options != NULL)