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

MiNT-Net: ncftp-1.9.2



Hi all!

Here are some diffs for ncftp-1.9.2 for MiNT-Net. Recompiling is easy
so I don't want to distribute a binary. Have fun.

Bye,
Knarf

diff -urN ncftp-1.9.2.orig/Makefile ncftp-1.9.2/Makefile
--- ncftp-1.9.2.orig/Makefile	Sat Jan 21 06:15:13 1995
+++ ncftp-1.9.2/Makefile	Mon Feb  6 10:52:49 1995
@@ -7,13 +7,18 @@
 
 
 # System dependent definitions.  See the README, part B.
+# Under MiNT you have to define HOSTNAME otherwise the nonstandard
+# file /etc/host is read in order to determine your FQDN.
+# HOSTNAME is only used for building your EMail-address during
+# the anonymous ftp login.
 #--------------------------------------------------------------------------
-SDEFS = 
+SDEFS = -DBSD -DNO_MKTIME -DHOSTNAME=\"host.domain.net\"
+
 
 
 # Program definitions.  See the README, part C.
 #--------------------------------------------------------------------------
-PDEFS =
+PDEFS = -DCURSES -DTRY_ABOR
 #PDEFS = -DGETLINE
 #PDEFS = -DREADLINE -DCURSES
 #PDEFS = -DSOCKS
@@ -24,8 +29,9 @@
 # Choose your compiler and flags below.  Make sure you use an ANSI compiler
 # that handles new style function declarations and prototypes (gcc should).
 #--------------------------------------------------------------------------
-CC = cc
-#CC = gcc
+#CC = cc
+CC = gcc
+#CC = cgcc
 
 #CFLAGS = $(TERM_INC) -O
 CFLAGS = $(TERM_INC) -O2
@@ -53,7 +59,7 @@
 # You'll need to know where the Rconnect.o object file is if you want
 #   to use Socks.
 #--------------------------------------------------------------------------
-LIBS =
+LIBS = -lsocket -lcurses -ltermcap
 #LIBS = -ldbmalloc
 #LIBS = -lgetline
 #LIBS = -lreadline -lcurses
@@ -103,7 +109,7 @@
 #--------------------------------------------------------------------------
 #BINDIR = /usr/lbin
 BINDIR = /usr/local/bin
-MANDIR = /usr/man/man1
+MANDIR = /usr/local/man/man1
 #MANDIR = 
 #CATMANDIR = /usr/catman/LOCAL/g1
 CATMANDIR =
@@ -186,7 +192,10 @@
 	-@echo 'Done.'
 
 clean:
-	rm -f $(OBJS) $(NAME)
+	rm -f $(OBJS)
+
+realclean: clean
+	rm -f $(NAME)
 
 # Dependencies:
 cmds.o: cmds.c 
diff -urN ncftp-1.9.2.orig/README.MiNT ncftp-1.9.2/README.MiNT
--- ncftp-1.9.2.orig/README.MiNT	Thu Jan  1 01:00:00 1970
+++ ncftp-1.9.2/README.MiNT	Mon Feb  6 11:03:18 1995
@@ -0,0 +1,50 @@
+This is the first version of ncftp-1.9.2 for MiNT. I just put the
+changes from Torsten Scherer into this newer source and removed the
+code for reading /etc/host if HOSTNAME is set. I recommend setting
+HOSTNAME in the Makefile, because then you don't have to put the
+nonstandard file /etc/host into your filesystem.
+
+Note: The HOSTNAME setting in the Makefile has nothing to do with the
+contents of /etc/hostname or $HOSTNAME which are read by gethostname()
+of the MiNT library.  Since there are at least three different
+`domains' (DNS-, Mail, and IP-domain) which all may have different
+values on the same machine, it does not make sense to set the hostname
+to a name with a domain.
+
+There are still some problems with this port of ncftp, but I think our
+current curses implementation is broken. The stty-settings seem to be
+ignored, so Backspace (^H) does not work as expected, and you have to
+use Delete (^?) instead. Kill line (^U) and reprint (^R) works, but
+gives you a newline.  I tried to compile with the getline library, but
+the testprogram failed. TeSche already ported the GNU readline library,
+but it's too big for an ftp client.
+
+Original source code may be found at ftp://ftp.cs.unl.edu/pub/ncftp.
+
+Bye,
+Knarf (knarf@nasim.cube.net)
+
+Original README.MiNT from Torsten Scherer follows:
+
+---cut---
+ This is version 02 of my ncftp 1.7.5 port for MiNT plus MiNTNet. It's a much
+nicer ftp client than the usual ones. If you haven't heard of it, just have
+a look. :-)
+
+ You'll need at least MiNTNet 0.41 to run it (and therefore a patched MiNT
+1.10) and additionally curses.olb to recompile it, if you should want to do
+that. Note that this version uses an /etc/host file to get the full host name,
+the one with domain suffix. If there isn't such a file around, it won't run.
+
+ Also note that I've only tested it on a VT52 terminal and also only with
+`localhost' as target adress, but it seems to be ok for me. If you encounter
+any bugs in this MiNT port, don't hesitate to contact me. If you find any
+bugs in the original code, contact the original author.
+
+ciao,
+TeSche
+--
+Torsten Scherer (TeSche, Schiller...), itschere@techfak.uni-bielefeld.de
+Faculty of Technology, University of Bielefeld, Germany, Europe, Earth...
+| Use any of "finger itschere@129.70.131.2-15" for adresses and more.	|
+| Last updated: 14. April 1994.						|
diff -urN ncftp-1.9.2.orig/cmds.c ncftp-1.9.2/cmds.c
--- ncftp-1.9.2.orig/cmds.c	Sat Jan 21 06:15:11 1995
+++ ncftp-1.9.2/cmds.c	Mon Feb  6 10:52:54 1995
@@ -23,6 +23,10 @@
 #	include <syslog.h>
 #endif
 
+#if defined(__MINT__) && !defined(HOSTNAME)
+#	include <fcntl.h>
+#endif
+
 #include "util.h"
 #include "cmds.h"
 #include "main.h"
@@ -1765,6 +1769,34 @@
 
 int getlocalhostname(char *host, size_t size)
 {
+#if defined(__MINT__) && !defined(HOSTNAME)
+
+	int	fh, r;
+	char	*ptr;
+
+	if ((fh = open("/etc/host", O_RDONLY)) < 0) {
+		fprintf(stderr, "Can't resolve your full hostname! Please make sure there's\n");
+		fprintf(stderr, "a file /etc/host around with the full hostname in it.\n");
+		exit(1);
+	}
+
+	if ((r = read(fh, host, size)) > 0)
+		host[r] = 0;
+	else {
+		fprintf(stderr, "Can't read your /etc/host file!\n");
+		exit(1);
+	}
+	ptr = host;
+	while (*ptr)
+		if ((*ptr == 10) || (*ptr == 13))
+			*ptr = 0;
+		else
+			ptr++;
+	close(fh);
+
+	return 0;
+
+#else /* __MINT__ && !HOSTNAME */
 	int oldv, r;
 	char *argv[2];
 	char domain[64];
@@ -1827,6 +1859,7 @@
 	}
 	return r;
 #endif
+#endif /* __MINT __ && !HOSTNAME */
 }	/* getlocalhostname */
 
 
diff -urN ncftp-1.9.2.orig/ftp.c ncftp-1.9.2/ftp.c
--- ncftp-1.9.2.orig/ftp.c	Sat Jan 21 06:15:12 1995
+++ ncftp-1.9.2/ftp.c	Mon Feb  6 10:53:00 1995
@@ -653,7 +653,11 @@
 
 
 
+#ifdef __MINT__
+static int empty(fd_set *mask, int sec)
+#else
 static int empty(struct fd_set *mask, int sec)
+#endif
 {
 	struct timeval t;
 
@@ -1545,7 +1549,11 @@
 	int							oldtype = -1, is_retr;
 	int							nfnd;
 	char						msg;
+#ifdef __MINT__
+	fd_set					mask;
+#else
 	struct fd_set				mask;
+#endif
 	int							filetype, do_reports = 0;
 	string						remote_dir;
 	time_t						remfTime = 0;
diff -urN ncftp-1.9.2.orig/ftprc.c ncftp-1.9.2/ftprc.c
--- ncftp-1.9.2.orig/ftprc.c	Sat Jan 21 06:15:12 1995
+++ ncftp-1.9.2/ftprc.c	Mon Feb  6 10:53:02 1995
@@ -81,7 +81,16 @@
 	if ((st.st_mode & 077) != 0)				/* rc must be unreadable by others. */
 		(void) chmod(rcname, 0600);
 
+#ifdef __MINT__
+	/*
+	 *  Sigh... There you set the default open to be binary to get rid of
+	 * all the problems and then you've got to reset it here because some-
+	 * one might have CRLF endings in his/her ~/.netrc...
+	 */
+	if ((fp = fopen(rcname, "rt")) == NULL) {
+#else
 	if ((fp = fopen(rcname, "r")) == NULL) {
+#endif
 		PERROR("thrash_rc", rcname);
 		return -1;
 	}
@@ -526,7 +535,11 @@
 
 	site_found = 0;
 
+#ifdef __MINT__
+	if ((fp = fopen(rcname, "rt")) != NULL) {
+#else
 	if ((fp = fopen(rcname, "r")) != NULL) {
+#endif
 		parsing_rc = 1;
 		while (FGets(str, fp)) {
 			if ((cp = strstr(str, "machine")) != 0) {
diff -urN ncftp-1.9.2.orig/glob.c ncftp-1.9.2/glob.c
--- ncftp-1.9.2.orig/glob.c	Sat Jan 21 06:15:12 1995
+++ ncftp-1.9.2/glob.c	Mon Feb  6 10:53:03 1995
@@ -216,7 +216,11 @@
 			return;
 		goto patherr2;
 	}
+#ifdef __MINT__
+	if (stat(*gpath ? gpath : ".", &stb) < 0)
+#else
 	if (fstat(dirp->dd_fd, &stb) < 0)
+#endif
 		goto patherr1;
 	if (!isdir(stb)) {
 		errno = ENOTDIR;
diff -urN ncftp-1.9.2.orig/main.c ncftp-1.9.2/main.c
--- ncftp-1.9.2.orig/main.c	Sat Jan 21 06:15:12 1995
+++ ncftp-1.9.2/main.c	Mon Feb  6 10:53:12 1995
@@ -138,6 +138,12 @@
 	string				tmp, oline;
 	struct servent		*sptr;
 
+#ifdef __MINT__
+	/* tesche: all fopen()s should be in binary mode */
+	extern int __default_mode__;
+	__default_mode__ |= _IOBIN;
+#endif
+
 	if ((cp = rindex(argv[0], '/'))) cp++;
 	else cp = argv[0];
 	(void) Strncpy(progname, cp);
diff -urN ncftp-1.9.2.orig/main.h ncftp-1.9.2/main.h
--- ncftp-1.9.2.orig/main.h	Sat Jan 21 06:15:13 1995
+++ ncftp-1.9.2/main.h	Mon Feb  6 10:53:12 1995
@@ -38,7 +38,11 @@
 #		ifdef NO_CONST
 			extern char *tgetstr(char *, char **);
 #		else
-			extern char *tgetstr(const char *, char **);
+#			ifdef __MINT__
+				extern char *tgetstr(char *, char **);
+#			else
+				extern char *tgetstr(const char *, char **);
+#			endif
 #		endif
 #	endif	/* TERMH */
 #endif	/* CURSES */
-- 
    Frank Bartels    |      UUCP/ZModem: + 49 89 5469593       | MiNT is
knarf@nasim.cube.net | Login: nuucp Index: /pub/ls-lR.nasim.gz | Now TOS!