lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev [PATCH][dev20] --disable-ftp


From: John Bley
Subject: lynx-dev [PATCH][dev20] --disable-ftp
Date: Mon, 22 Mar 1999 13:11:37 -0500 (EST)

This is a first try at --disable-ftp, works fine for me but I can't test 
the configure.in patch since autoconf is still throwing hissyfits.

* Attempt to implement --disable-ftp (John Bley)

Hmmm.. I seem to have fixed the same bug again (the DISABLE_NEWS being in 
the wrong place in HTAccess.c) - I'll manually verify correctness in 
dev21 in case patch weirdness occurs.

-- 
John Bley - address@hidden
Duke '99 - English/Computer Science
  Since English is a mess, it maps well onto the problem space,
  which is also a mess, which we call reality.     - Larry Wall

diff -Burp lynx2-8-2/WWW/Library/Implementation/HTAccess.c 
lynx2-8-2-patched/WWW/Library/Implementation/HTAccess.c
--- lynx2-8-2/WWW/Library/Implementation/HTAccess.c     Wed Mar 17 22:17:11 1999
+++ lynx2-8-2-patched/WWW/Library/Implementation/HTAccess.c     Mon Mar 22 
12:55:13 1999
@@ -131,7 +131,9 @@ extern GLOBALREF (HTProtocol, HTTelnet);
 extern GLOBALREF (HTProtocol, HTTn3270);
 extern GLOBALREF (HTProtocol, HTRlogin);
 #ifndef DECNET
+#ifndef DISABLE_FTP
 extern GLOBALREF (HTProtocol, HTFTP);
+#endif /* DISABLE_FTP */
 #ifndef DISABLE_NEWS
 extern GLOBALREF (HTProtocol, HTNews);
 extern GLOBALREF (HTProtocol, HTNNTP);
@@ -155,7 +157,9 @@ extern GLOBALREF (HTProtocol, HTWAIS);
 #else
 GLOBALREF HTProtocol HTTP, HTTPS, HTFile, HTTelnet, HTTn3270, HTRlogin;
 #ifndef DECNET
+#ifndef DISABLE_FTP
 GLOBALREF HTProtocol HTFTP;
+#endif /* DISABLE_FTP */
 #ifndef DISABLE_NEWS
 GLOBALREF HTProtocol HTNews, HTNNTP, HTNewsPost, HTNewsReply;
 GLOBALREF HTProtocol HTSNews, HTSNewsPost, HTSNewsReply;
@@ -181,8 +185,10 @@ PRIVATE void HTAccessInit NOARGS                   /* Ca
     HTRegisterProtocol(&HTTn3270);
     HTRegisterProtocol(&HTRlogin);
 #ifndef DECNET
-#ifndef DISABLE_NEWS
+#ifndef DISABLE_FTP
     HTRegisterProtocol(&HTFTP);
+#endif /* DISABLE_FTP */
+#ifndef DISABLE_NEWS
     HTRegisterProtocol(&HTNews);
     HTRegisterProtocol(&HTNNTP);
     HTRegisterProtocol(&HTNewsPost);
diff -Burp lynx2-8-2/WWW/Library/Implementation/HTFTP.c 
lynx2-8-2-patched/WWW/Library/Implementation/HTFTP.c
--- lynx2-8-2/WWW/Library/Implementation/HTFTP.c        Wed Mar 17 22:17:11 1999
+++ lynx2-8-2-patched/WWW/Library/Implementation/HTFTP.c        Mon Mar 22 
13:01:00 1999
@@ -143,6 +143,7 @@ struct _HTStructured {
 **     ---------------------
 */
 PUBLIC int HTfileSortMethod = FILE_BY_NAME;
+#ifndef DISABLE_FTP /*This disables everything to end-of-file */
 PRIVATE char ThisYear[8];
 PRIVATE char LastYear[8];
 PRIVATE int TheDate;
@@ -3282,3 +3283,5 @@ PUBLIC void HTClearFTPPassword NOARGS
     */
     FREE(user_entered_password);
 }
+
+#endif /* ifndef DISABLE_FTP */
diff -Burp lynx2-8-2/WWW/Library/Implementation/HTFile.c 
lynx2-8-2-patched/WWW/Library/Implementation/HTFile.c
--- lynx2-8-2/WWW/Library/Implementation/HTFile.c       Wed Feb 17 09:29:33 1999
+++ lynx2-8-2-patched/WWW/Library/Implementation/HTFile.c       Mon Mar 22 
12:59:23 1999
@@ -1516,7 +1516,11 @@ PUBLIC int HTLoadFile ARGS4(
        FREE(filename);
        FREE(nodename);
        FREE(acc_method);
+#ifndef DISABLE_FTP
        return HTFTPLoad(addr, anchor, format_out, sink);
+#else 
+       return -1;
+#endif /* DISABLE_FTP */
     } else {
        FREE(newname);
        FREE(acc_method);
@@ -2416,7 +2420,11 @@ PUBLIC int HTLoadFile ARGS4(
                             * is file://localhost
                             */
            } else {
+#ifndef DISABLE_FTP
                return HTFTPLoad(addr, anchor, format_out, sink);
+#else
+               return -1;
+#endif /* DISABLE_FTP */
            }
        }
        FREE(nodename);
diff -Burp lynx2-8-2/configure.in lynx2-8-2-patched/configure.in
--- lynx2-8-2/configure.in      Wed Mar 17 22:17:11 1999
+++ lynx2-8-2-patched/configure.in      Mon Mar 22 13:04:39 1999
@@ -783,6 +783,14 @@ CF_ARG_DISABLE(news,
 AC_MSG_RESULT($use_news)
 test $use_news != "no" && AC_DEFINE(DISABLE_NEWS)
 
+AC_MSG_CHECKING(if you want to exclude FTP code)
+CF_ARG_DISABLE(ftp,
+[  --disable-ftp  disable FTP logic],
+      [use_ftp=yes],
+      [use_ftp=no])
+AC_MSG_RESULT($use_ftp)
+test $use_ftp != "no" && AC_DEFINE(DISABLE_FTP)
+
 dnl --------------------------------------------------------------------------
 dnl DirEd (directory-editor) options
 dnl --------------------------------------------------------------------------
diff -Burp lynx2-8-2/src/LYMainLoop.c lynx2-8-2-patched/src/LYMainLoop.c
--- lynx2-8-2/src/LYMainLoop.c  Wed Mar 17 22:17:11 1999
+++ lynx2-8-2-patched/src/LYMainLoop.c  Mon Mar 22 12:52:32 1999
@@ -5716,7 +5716,9 @@ check_add_bookmark_to_self:
 #ifndef DISABLE_NEWS
                    HTClearNNTPAuthInfo();
 #endif
+#ifndef DISABLE_FTP
                    HTClearFTPPassword();
+#endif
                    HTUserMsg(AUTH_INFO_CLEARED);
                } else {
                    HTUserMsg(CANCELLED);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]