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

Re: Problem with ftp from 0.3c to 0.3b



>>>>> "Assar" == Assar Westerlund <assar@sics.se> writes:

    Assar> Brian May <bmay@csse.monash.edu.au> writes:
    >> 1. No newline printed after the prompt.

    Assar> That's simple enough.  The trivial patch is appended.

It applies ok. Thanks.

    >> Yes, silly as it might seem,
    >> there is actually a Debian bug report on this matter - see
    >> http://bugs.debian.org/64289, as it breaks efs (emacs).
    >> (also a related? bug report was http://bugs.debian.org/69301).

    Assar> Sorry for not having looked at the command-line editing stuff 'till
    Assar> now.  There's a simple patch for adding `-l' appended.  But there
    Assar> might be more stuff needed to make efs happy?

Some things wrong with the patch:

[825] [snoopy:bam] ~/cvswork/heimdal/appl/ftp/ftp >patch -p0 < ~/diff2
patching file `Makefile.am'
patch: **** malformed patch at line 13: Index: ftp_var.h

I think the problem is Makefile.am - it is included, but hasn't been
changed. I think 6 lines are required, instead of only 3.

    Assar> rsh: juguete.sics.se: Server not found in Kerberos database
    Assar> Index: Makefile.am
    Assar> ===================================================================
    Assar> RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/appl/ftp/ftp/Makefile.am,v
    Assar> retrieving revision 1.13
    Assar> diff -u -w -r1.13 Makefile.am
    Assar> --- Makefile.am	2000/01/06 15:11:43	1.13
    Assar> +++ Makefile.am	2000/10/04 06:21:26
    Assar> @@ -41,6 +41,6 @@
    Assar> $(LIB_gssapi) \
    Assar> $(LIB_krb5) \
    Assar> $(LIB_krb4) \
    Assar> Index: ftp_var.h
    Assar> ===================================================================
    Assar> RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/appl/ftp/ftp/ftp_var.h,v
    Assar> retrieving revision 1.10
    Assar> diff -u -w -r1.10 ftp_var.h
    Assar> --- ftp_var.h	2000/06/21 02:46:09	1.10
    Assar> +++ ftp_var.h	2000/10/04 06:21:26
    Assar> @@ -52,6 +52,7 @@
    Assar> extern int	connected;		/* connected to server */
    Assar> extern int	fromatty;		/* input is from a terminal */
    Assar> extern int	interactive;		/* interactively prompt on m* cmds */
    Assar> +extern int	lineedit;		/* use line-editing */
    Assar> extern int	debug;			/* debugging level */
    Assar> extern int	bell;			/* ring bell on cmd completion */
    Assar> extern int	doglob;			/* glob local file names */
    Assar> Index: globals.c
    Assar> ===================================================================
    Assar> RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/appl/ftp/ftp/globals.c,v
    Assar> retrieving revision 1.7
    Assar> diff -u -w -r1.7 globals.c
    Assar> --- globals.c	2000/06/21 02:46:09	1.7
    Assar> +++ globals.c	2000/10/04 06:21:26
    Assar> @@ -11,6 +11,7 @@
    Assar> int	connected;		/* connected to server */
    Assar> int	fromatty;		/* input is from a terminal */
    Assar> int	interactive;		/* interactively prompt on m* cmds */
    Assar> +int	lineedit;		/* use line-editing */
    Assar> int	debug;			/* debugging level */
    Assar> int	bell;			/* ring bell on cmd completion */
    Assar> int	doglob;			/* glob local file names */
    Assar> Index: main.c
    Assar> ===================================================================
    Assar> RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/appl/ftp/ftp/main.c,v
    Assar> retrieving revision 1.29
    Assar> diff -u -w -r1.29 main.c
    Assar> --- main.c	2000/10/04 06:08:54	1.29
    Assar> +++ main.c	2000/10/04 06:21:26
    Assar> @@ -54,10 +54,11 @@
    Assar> doglob = 1;
    Assar> interactive = 1;
    Assar> autologin = 1;
    Assar> +	lineedit = 1;
    Assar> passivemode = 0; /* passive mode not active */
    Assar> use_kerberos = 1;
 
    Assar> -	while ((ch = getopt(argc, argv, "dginptvK")) != -1) {
    Assar> +	while ((ch = getopt(argc, argv, "dgilnptvK")) != -1) {
    Assar> switch (ch) {
    Assar> case 'd':
    Assar> options |= SO_DEBUG;
    Assar> @@ -72,6 +73,9 @@
    Assar> interactive = 0;
    Assar> break;
 
    Assar> +		case 'l':
    Assar> +			lineedit = 0;
    Assar> +			break;
    Assar> case 'n':
    Assar> autologin = 0;
    Assar> break;
    Assar> @@ -94,7 +98,7 @@
 
    Assar> default:
    Assar> fprintf(stderr,
    Assar> -                            "usage: ftp [-dginptvK] [host [port]]\n");
    Assar> +                            "usage: ftp [-dgilnptvK] [host [port]]\n");
    Assar> exit(1);
    Assar> }
    Assar> }
    Assar> @@ -206,10 +210,8 @@
    Assar> }
    Assar> */
 
    Assar> -#ifndef HAVE_READLINE
    Assar> -
    Assar> static char *
    Assar> -readline(char *prompt)
    Assar> +simple_readline(char *prompt)
    Assar> {
    Assar> char buf[BUFSIZ];
    Assar> printf ("%s", prompt);
    Assar> @@ -221,6 +223,14 @@
    Assar> return strdup(buf);
    Assar> }
 
    Assar> +#ifndef HAVE_READLINE
    Assar> +
    Assar> +static char *
    Assar> +readline(char *prompt)
    Assar> +{
    Assar> +    return simple_readline (prompt);
    Assar> +}
    Assar> +
    Assar> static void
    Assar> add_history(char *p)
    Assar> {
    Assar> @@ -249,12 +259,16 @@
    Assar> for (;;) {
    Assar> if (fromatty) {
    Assar> char *p;
    Assar> +	    if (lineedit)
    Assar> p = readline("ftp> ");
    Assar> +	    else
    Assar> +		p = simple_readline("ftp> ");
    Assar> if(p == NULL) {
    Assar> printf("\n");
    Assar> quit(0, 0);
    Assar> }
    Assar> strlcpy(line, p, sizeof(line));
    Assar> +	    if (lineedit)
    Assar> add_history(p);
    Assar> free(p);
    Assar> } else{

-- 
Brian May <bmay@csse.monash.edu.au>