diff lib/config_file.c @ 607:f946521bb2f2

2004-11-1 Brian Masney <masneyb@gftp.org> * lib/config_file.c (gftp_write_bookmarks_file) - if a folder has no children, make sure the entry has a / appended to the end of the description. Don't write out any of the other unneeded fields
author masneyb
date Tue, 02 Nov 2004 02:15:14 +0000
parents b60dad25b641
children d97e985f5dbe
line wrap: on
line diff
--- a/lib/config_file.c	Tue Nov 02 01:59:23 2004 +0000
+++ b/lib/config_file.c	Tue Nov 02 02:15:14 2004 +0000
@@ -764,34 +764,40 @@
       while (*tempstr == '/')
 	tempstr++;
 
-      if (tempentry->save_password && tempentry->pass != NULL)
-        password = gftp_scramble_password (tempentry->pass);
+      if (tempentry->isfolder)
+        {
+          fprintf (bmfile, "[%s/]\n", tempstr);
+        }
       else
-        password = NULL;
+        {
+          if (tempentry->save_password && tempentry->pass != NULL)
+            password = gftp_scramble_password (tempentry->pass);
+          else
+            password = NULL;
 
-      fprintf (bmfile,
-	       "[%s]\nhostname=%s\nport=%d\nprotocol=%s\nremote directory=%s\nlocal directory=%s\nusername=%s\npassword=%s\naccount=%s\n",
-	       tempstr, tempentry->hostname == NULL ? "" : tempentry->hostname,
-	       tempentry->port, tempentry->protocol == NULL
-	       || *tempentry->protocol ==
-	       '\0' ? gftp_protocols[0].name : tempentry->protocol,
-	       tempentry->remote_dir == NULL ? "" : tempentry->remote_dir,
-	       tempentry->local_dir == NULL ? "" : tempentry->local_dir,
-	       tempentry->user == NULL ? "" : tempentry->user,
-	       password == NULL ? "" : password,
-	       tempentry->acct == NULL ? "" : tempentry->acct);
+          fprintf (bmfile,
+    	       "[%s]\nhostname=%s\nport=%d\nprotocol=%s\nremote directory=%s\nlocal directory=%s\nusername=%s\npassword=%s\naccount=%s\n",
+    	       tempstr, tempentry->hostname == NULL ? "" : tempentry->hostname,
+    	       tempentry->port, tempentry->protocol == NULL
+    	       || *tempentry->protocol ==
+    	       '\0' ? gftp_protocols[0].name : tempentry->protocol,
+    	       tempentry->remote_dir == NULL ? "" : tempentry->remote_dir,
+    	       tempentry->local_dir == NULL ? "" : tempentry->local_dir,
+    	       tempentry->user == NULL ? "" : tempentry->user,
+    	       password == NULL ? "" : password,
+    	       tempentry->acct == NULL ? "" : tempentry->acct);
+          if (password != NULL)
+            g_free(password);
 
-      if (password != NULL)
-        g_free(password);
-
-      if (tempentry->local_options_vars != NULL)
-        {
-          for (i=0; i<tempentry->num_local_options_vars; i++)
+          if (tempentry->local_options_vars != NULL)
             {
-              gftp_option_types[tempentry->local_options_vars[i].otype].write_function (&tempentry->local_options_vars[i], buf, sizeof (buf), 1);
-
-              fprintf (bmfile, "%s=%s\n", tempentry->local_options_vars[i].key,
-                       buf);
+              for (i=0; i<tempentry->num_local_options_vars; i++)
+                {
+                  gftp_option_types[tempentry->local_options_vars[i].otype].write_function (&tempentry->local_options_vars[i], buf, sizeof (buf), 1);
+    
+                  fprintf (bmfile, "%s=%s\n", tempentry->local_options_vars[i].key,
+                           buf);
+                }
             }
         }