4.5.99a (mc-2002-04-26-03) .netrc patch
Thomas Zajic
zlatko at gmx.at
Tue Apr 30 06:02:42 UTC 2002
* Thomas Zajic <zlatko at gmx.at>, 29/04/2002, 00:24
> Enabling and disabling ~/.netrc lookups (via use_netrc in ~/.mc/ini)
> works fine as well. I haven't had a look at the menu code in boxes.c
> yet, though, so you still have to edit ~/.mc/ini manually.
Enabling and disabling ~/.netrc lookups in the VFS settings menu works
now - patch attached. Applies & compiles cleanly against the mc-4.5.99a
2002-04-26-21 snapshot.
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 Mon Apr 29 09:06:49 2002
@@ -716,7 +716,11 @@
#ifdef USE_VFS
#if defined(USE_NETCODE)
+#if defined(USE_NETRC)
+#define VFSY 15
+#else
#define VFSY 14
+#endif
#else
#define VFSY 8
#endif
@@ -741,18 +745,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,
@@ -781,7 +783,11 @@
{ VFSX, VFSY, -1, -1, N_(" Virtual File System Setting "), "[Virtual FS]", "quick_vfs", confvfs_widgets, 0 };
#if defined(USE_NETCODE)
+#if defined(USE_NETRC)
+#define VFS_WIDGETBASE 8
+#else
#define VFS_WIDGETBASE 7
+#endif
#else
#define VFS_WIDGETBASE 0
#endif
@@ -792,6 +798,11 @@
char buffer2[BUF_TINY];
#if defined(USE_NETCODE)
char buffer3[BUF_TINY];
+#if defined(USE_NETRC)
+#define NETRC_OFFSET 1
+#else
+#define NETRC_OFFSET 0
+#endif
#endif
g_snprintf (buffer2, sizeof (buffer2), "%i", vfs_timeout);
@@ -799,9 +810,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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20020430/11c61f85/attachment.asc>
More information about the mc-devel
mailing list