4.5.99a (mc-2002-04-26-03) .netrc patch

Thomas Zajic zlatko at gmx.at
Tue Apr 30 18:55:18 UTC 2002


* Andrew V. Samoilov <sav at it.efp.com.ua>, 30/04/2002, 12:03

> > diff -ur mc-4.5.99a-orig/src/boxes.c mc-4.5.99a/src/boxes.c
> > --- mc-4.5.99a-orig/src/boxes.c	Mon Oct  1 08:51:15 2001
> > +++ mc-4.5.99a/src/boxes.c	Mon Apr 29 09:06:49 2002
> > @@ -716,7 +716,11 @@
> >  #ifdef USE_VFS
> >  
> >  #if defined(USE_NETCODE)
> 
> I think NETRC_OFFSET could be defined here.

That, and VFS_WIDGETBASE. You're right. New patch attached.

> So code below can be smaller.

Source code size wasn't one of my considerations, admittedly. ;-)

Bye,
Thomas
-- 
=-------------------------------------------------------------------------=
- Thomas "ZlatkO" Zajic   <zlatko at gmx.at>    Linux-2.4.18 & Mutt-1.2.5.1i -
-  "It is not easy to cut through a human head with a hacksaw."  (M. C.)  -
=-------------------------------------------------------------------------=
-------------- next part --------------
diff -ur mc-4.5.99a-orig/src/boxes.c mc-4.5.99a/src/boxes.c
--- mc-4.5.99a-orig/src/boxes.c	Mon Oct  1 08:51:15 2001
+++ mc-4.5.99a/src/boxes.c	Tue Apr 30 20:47:51 2002
@@ -716,9 +716,18 @@
 #ifdef USE_VFS
 
 #if defined(USE_NETCODE)
+#if defined(USE_NETRC)
+#define VFSY 15
+#define VFS_WIDGETBASE 8
+#define NETRC_OFFSET 1
+#else
 #define VFSY 14
+#define VFS_WIDGETBASE 7
+#define NETRC_OFFSET 0
+#endif
 #else
 #define VFSY 8
+#define VFS_WIDGETBASE 0
 #endif
 
 #define VFSX 56
@@ -741,18 +750,16 @@
 static int ret_use_netrc;
 #endif
 
-#if 0
-/* Not used currently */
-{ quick_checkbox,  4, VFSX, 10, VFSY, "Use ~/.netrc",
-      'U', 0, 0, &ret_use_netrc, 0, "" },
-#endif
-
 static QuickWidget confvfs_widgets [] = {
 { quick_button,   30,  VFSX,    VFSY - 3, VFSY, N_("&Cancel"),
       0, B_CANCEL, 0, 0, "button-cancel" },
 { quick_button,   12, VFSX,    VFSY - 3, VFSY, N_("&Ok"),
       0, B_ENTER, 0, 0, "button-ok" },
 #if defined(USE_NETCODE)
+#if defined(USE_NETRC)
+{ quick_checkbox,  4, VFSX, 10, VFSY, N_("&Use ~/.netrc"), 0, 0,
+      &ret_use_netrc, 0, "check-use-netrc" },
+#endif
 { quick_input,     4, VFSX, 9, VFSY, "", 48, 0, 0, &ret_ftp_proxy,
       "input-ftp-proxy" },
 { quick_checkbox,  4, VFSX, 8, VFSY, N_("&Always use ftp proxy"), 0, 0,
@@ -780,12 +787,6 @@
 static QuickDialog confvfs_dlg =
 { VFSX, VFSY, -1, -1, N_(" Virtual File System Setting "), "[Virtual FS]", "quick_vfs", confvfs_widgets, 0 };
 
-#if defined(USE_NETCODE)
-#define VFS_WIDGETBASE 7
-#else
-#define VFS_WIDGETBASE 0
-#endif
-
 void
 configure_vfs (void)
 {
@@ -799,9 +800,9 @@
 #if defined(USE_NETCODE)
     ret_use_netrc = use_netrc;
     g_snprintf(buffer3, sizeof (buffer3), "%i", ftpfs_directory_timeout);
-    confvfs_widgets[5].text = buffer3;
-    confvfs_widgets[7].text = ftpfs_anonymous_passwd;
-    confvfs_widgets[2].text = ftpfs_proxy_host;
+    confvfs_widgets[5 + NETRC_OFFSET].text = buffer3;
+    confvfs_widgets[7 + NETRC_OFFSET].text = ftpfs_anonymous_passwd;
+    confvfs_widgets[2 + NETRC_OFFSET].text = ftpfs_proxy_host;
 #endif
 
     if (quick_dialog (&confvfs_dlg) != B_CANCEL) {


More information about the mc-devel mailing list