home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-30 | 32.6 KB | 1,140 lines |
- Newsgroups: comp.sources.misc
- From: mgleason@cse.unl.edu (Mike Gleason)
- Subject: v39i065: ncftp - Alternative User Interface for FTP, v1.5.0, Patch01
- Message-ID: <1993Aug30.114552.21082@sparky.sterling.com>
- X-Md4-Signature: 7752353c385694f848fa6d4590ff6e22
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: NCEMRSoft
- Date: Mon, 30 Aug 1993 11:45:52 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
- Posting-number: Volume 39, Issue 65
- Archive-name: ncftp/patch01
- Environment: UNIX, ANSI-C, !SVR4
- Patch-To: ncftp: Volume 39, Issue 53-57
-
- This is the first official patch to ncftp 1.5, posted last week. This
- patch fixes some bugs and adds a little portability.
-
- I will put up the fully-patched version up for ftp sometime after Sept. 5.
-
- /* v1.5.1 - August 29, 1993
- * Bugs fixed in termcap code, mput, and pwd. No longer adding blank
- * lines to readline's history. Netrc site abbreviations were matched
- * by strncmp() when it should have been strstr(). Bug fixed in
- * open's site "menu." Revised tips a little to encourage .ncftprc instead
- * of .netrc. TRY_ABOR documented in the README. Added stuff to the
- * DYNIX entry. Hacks added for SCO322. Shortened bargraph prog meter
- * by one char. Better compat with getline. Man page fixed by DWS again :)
- */
-
- diff -c ./README ../ncftp151/README
- *** ./README Tue Aug 24 16:33:43 1993
- --- ../ncftp151/README Sun Aug 29 21:47:35 1993
- ***************
- *** 99,105 ****
- set CFLAGS= -Aa. You may also need to use gcc if your
- compiler is non-ANSI.
-
- ! SCO Unix: Add -DSCO324 to SDEFS, and -lsocket to LIBS.
-
- Bull DPX/2: Add -DBULL to SDEFS, add -linet to LIBS, and
- use gcc.
- --- 99,106 ----
- set CFLAGS= -Aa. You may also need to use gcc if your
- compiler is non-ANSI.
-
- ! SCO Unix: Add -DSCO324 or -DSCO322 (as appropriate) to SDEFS,
- ! and -lsocket to LIBS.
-
- Bull DPX/2: Add -DBULL to SDEFS, add -linet to LIBS, and
- use gcc.
- ***************
- *** 106,112 ****
-
- Sequent's DYNIX: Use gcc and add -DDYNIX (if necessary) to SDEFS.
- You may also be short several string functions which you will
- ! have to get elsewhere.
-
- If your system doesn't fit any of those, things will be trickier. Answer
- all these questions and add to the SDEFS line. You may want to try
- --- 107,115 ----
-
- Sequent's DYNIX: Use gcc and add -DDYNIX (if necessary) to SDEFS.
- You may also be short several string functions which you will
- ! have to get elsewhere, and perhaps mktime and strftime.
- ! You can get all that stuff from the BSD sources (like ftp.uu.net).
- ! Please bug Sequent to update their libc library!
-
- If your system doesn't fit any of those, things will be trickier. Answer
- all these questions and add to the SDEFS line. You may want to try
- ***************
- *** 204,209 ****
- --- 207,216 ----
- with -DSOCKS added to PDEFS, and the pathname of the Rconnect.o file
- added to LIBS.
-
- + * -DTRY_ABOR: Define if you want to try the 'ABOR' command from ncftp;
- + The aborting code has had some problems, so by default the program
- + 'aborts' by continuing to read input but not echoing output.
- +
- * -DDB_ERRS: Define this if you want my Perror() function to be more
- verbose. You may want to do this if you are a programmer examining this
- code, and want to know where in the source the Perror's are coming
- diff -c ./cmds.c ../ncftp151/cmds.c
- *** ./cmds.c Tue Aug 24 16:33:42 1993
- --- ../ncftp151/cmds.c Sun Aug 29 21:47:35 1993
- ***************
- *** 315,322 ****
- (void) setjmp(jabort);
- for (i = 1; i < argc; i++) {
- register char **cpp, **gargs;
- !
- ! gargs = glob(argv[i]);
- if (globerr != NULL) {
- (void) printf("%s\n", globerr);
- if (gargs) {
- --- 315,330 ----
- (void) setjmp(jabort);
- for (i = 1; i < argc; i++) {
- register char **cpp, **gargs;
- ! char *icopy;
- !
- ! /* Make a copy of the argument, because glob() will just copy
- ! * the pointer you give it to the glob-arg vector, and blkfree()
- ! * will want to free each element of the glob-arg vector
- ! * later.
- ! */
- ! if ((icopy = NewString(argv[i])) == NULL)
- ! break;
- ! gargs = glob(icopy);
- if (globerr != NULL) {
- (void) printf("%s\n", globerr);
- if (gargs) {
- ***************
- *** 1039,1045 ****
- /*ARGSUSED*/
- int pwd(int argc, char **argv)
- {
- ! (void) quiet_command("PWD");
- return NOERR;
- } /* pwd */
-
- --- 1047,1053 ----
- /*ARGSUSED*/
- int pwd(int argc, char **argv)
- {
- ! (void) verbose_command("PWD");
- return NOERR;
- } /* pwd */
-
- ***************
- *** 1799,1804 ****
- --- 1807,1815 ----
- #endif
- #ifdef NO_VARARGS
- DStrs[nDStrs++] = "NO_VARARGS";
- + #endif
- + #ifdef TRY_ABOR
- + DStrs[nDStrs++] = "TRY_ABOR";
- #endif
- #ifdef GATEWAY
- DStrs[nDStrs++] = "GATEWAY";
- diff -c ./ftp.c ../ncftp151/ftp.c
- *** ./ftp.c Tue Aug 24 16:33:42 1993
- --- ../ncftp151/ftp.c Sun Aug 29 21:47:36 1993
- ***************
- *** 649,655 ****
- local,
- tcap_normal
- );
- ! barlen = 64;
- for (s = file_size; s > 0; s /= 10L) barlen--;
- (void) sprintf(spec, " 0 %%%ds %%ld bytes.\r", barlen);
- (void) printf(spec, " ", file_size);
- --- 649,655 ----
- local,
- tcap_normal
- );
- ! barlen = 63;
- for (s = file_size; s > 0; s /= 10L) barlen--;
- (void) sprintf(spec, " 0 %%%ds %%ld bytes.\r", barlen);
- (void) printf(spec, " ", file_size);
- ***************
- *** 1001,1007 ****
- activemcmd = 0;
- abrtflag = 0;
- (void) fprintf(stderr,
- ! #ifdef TryAbort
- "(abort)\n");
- #else
- "\nAborting, please wait...");
- --- 1001,1007 ----
- activemcmd = 0;
- abrtflag = 0;
- (void) fprintf(stderr,
- ! #ifdef TRY_ABOR
- "(abort)\n");
- #else
- "\nAborting, please wait...");
- ***************
- *** 1414,1420 ****
- do_reports = start_progress(0, local);
-
- if (setjmp(recvabort)) {
- ! #ifdef TryAbort
- goto Abort;
- #else
- /* Just read the rest of the stream without doing anything with
- --- 1414,1420 ----
- do_reports = start_progress(0, local);
-
- if (setjmp(recvabort)) {
- ! #ifdef TRY_ABOR
- goto Abort;
- #else
- /* Just read the rest of the stream without doing anything with
- diff -c ./ftprc.c ../ncftp151/ftprc.c
- *** ./ftprc.c Tue Aug 24 16:33:43 1993
- --- ../ncftp151/ftprc.c Sun Aug 29 21:47:37 1993
- ***************
- *** 450,456 ****
- cp++;
- } else
- continue;
- ! if (strncmp(cp, host, strlen(host)) == 0) {
- site_found = 1;
- while (!isspace(*cp))
- ++cp; /* skip the site name. */
- --- 450,456 ----
- cp++;
- } else
- continue;
- ! if (strstr(host, str) != NULL) {
- site_found = 1;
- while (!isspace(*cp))
- ++cp; /* skip the site name. */
- diff -c ./getpass.c ../ncftp151/getpass.c
- *** ./getpass.c Tue Aug 24 16:33:43 1993
- --- ../ncftp151/getpass.c Sun Aug 29 21:47:38 1993
- ***************
- *** 125,134 ****
- * read and write to /dev/tty if possible; else read from
- * stdin and write to stderr.
- */
- ! if ((outfp = fp = fopen("/dev/tty", "w+")) == NULL) {
- ! outfp = stderr;
- fp = stdin;
- ! }
- oldintr = Signal(SIGINT, SIG_IGN);
- echo(fp, 0); /* Turn echoing off. */
- (void) fputs(promptstr, outfp);
- --- 125,142 ----
- * read and write to /dev/tty if possible; else read from
- * stdin and write to stderr.
- */
- ! #if !defined(BOTCHED_FOPEN_RW)
- ! if ((outfp = fp = fopen("/dev/tty", "w+")) == NULL) {
- ! outfp = stderr;
- ! fp = stdin;
- ! }
- ! #else
- ! /* SCO 32v2 botches "w+" open */
- ! if ((fp = fopen("/dev/tty", "r")) == NULL)
- fp = stdin;
- ! if ((outfp = fopen("/dev/tty", "w")) == NULL)
- ! outfp = stderr;
- ! #endif
- oldintr = Signal(SIGINT, SIG_IGN);
- echo(fp, 0); /* Turn echoing off. */
- (void) fputs(promptstr, outfp);
- ***************
- *** 142,147 ****
- --- 150,159 ----
- (void) Signal(SIGINT, oldintr);
- if (fp != stdin)
- (void)fclose(fp);
- + #if defined(BOTCHED_FOPEN_RW)
- + if (outfp != stderr)
- + (void)fclose(outfp);
- + #endif
- return(buf);
- } /* Getpass */
-
- diff -c ./main.c ../ncftp151/main.c
- *** ./main.c Tue Aug 24 16:33:43 1993
- --- ../ncftp151/main.c Sun Aug 29 21:47:39 1993
- ***************
- *** 8,14 ****
- #define _main_c_
-
- #define FTP_VERSION \
- ! "NcFTP 1.5.0 (Aug 22, 1993) by Mike Gleason, NCEMRSoft."
-
- /* #define BETA 1 */ /* If defined, it prints a little warning message. */
-
- --- 8,14 ----
- #define _main_c_
-
- #define FTP_VERSION \
- ! "NcFTP 1.5.1 (Aug 29, 1993) by Mike Gleason, NCEMRSoft."
-
- /* #define BETA 1 */ /* If defined, it prints a little warning message. */
-
- ***************
- *** 85,94 ****
- * prompt as it will appear on screen,
- * (i.e. no invis escape codes).
- */
- ! char *tcap_normal = "\033[0m"; /* Default ANSI escapes */
- ! char *tcap_boldface = "\033[1m";
- ! char *tcap_underline = "\033[4m";
- ! char *tcap_reverse = "\033[7m";
- size_t tcl_normal = 4, /* lengths of the above strings. */
- tcl_bold = 4,
- tcl_uline = 4,
- --- 85,106 ----
- * prompt as it will appear on screen,
- * (i.e. no invis escape codes).
- */
- !
- ! #ifdef HPUX
- ! char *tcap_normal = "\033&d@"; /* Default ANSI escapes */
- ! char *tcap_boldface = "\033&dH"; /* Half Bright */
- ! char *tcap_underline = "\033&dD";
- ! char *tcap_reverse = "\033&dB";
- !
- ! #else
- !
- ! char *tcap_normal = "\033[0m"; /* Default ANSI escapes */
- ! char *tcap_boldface = "\033[1m";
- ! char *tcap_underline = "\033[4m";
- ! char *tcap_reverse = "\033[7m";
- !
- ! #endif
- !
- size_t tcl_normal = 4, /* lengths of the above strings. */
- tcl_bold = 4,
- tcl_uline = 4,
- ***************
- *** 964,985 ****
-
-
- #ifdef CURSES
- ! void termcap_get(char *dest, char *attr)
- {
- static char area[1024];
- static char *s = area;
- ! char buf[32];
- int foo;
-
- (void) Strncpy(buf, tgetstr(attr, &s));
- if (buf[0]) {
- for (foo = 0; (buf[foo] <= '9') && (buf[foo] >= '0'); foo++);
- ! if ((dest = (char *)malloc(strlen(&(buf[foo])) + 1)) == NULL)
- ! *dest = 0;
- else
- ! (void) strcpy(dest, &(buf[foo]));
- } else
- ! *dest = 0;
- } /* termcap_get */
-
-
- --- 976,997 ----
-
-
- #ifdef CURSES
- ! void termcap_get(char **dest, char *attr)
- {
- static char area[1024];
- static char *s = area;
- ! char buf[64];
- int foo;
-
- (void) Strncpy(buf, tgetstr(attr, &s));
- if (buf[0]) {
- for (foo = 0; (buf[foo] <= '9') && (buf[foo] >= '0'); foo++);
- ! if ((*dest = (char *)malloc(strlen(&(buf[foo])) + 1)) == NULL)
- ! **dest = 0;
- else
- ! (void) strcpy(*dest, &(buf[foo]));
- } else
- ! **dest = 0;
- } /* termcap_get */
-
-
- ***************
- *** 997,1011 ****
- if (tgetent(tcbuf,term) != 1) {
- (void) fprintf(stderr,"Can't get termcap entry for terminal [%s]\n", term);
- } else {
- ! termcap_get(tcap_normal, "me");
- ! termcap_get(tcap_boldface, "md");
- ! termcap_get(tcap_underline, "us");
- ! termcap_get(tcap_reverse, "so");
- tcl_normal = strlen(tcap_normal);
- tcl_bold = strlen(tcap_boldface);
- tcl_uline = strlen(tcap_underline);
- tcl_rev = strlen(tcap_reverse);
- }
- } /* termcap_init */
-
-
- --- 1009,1024 ----
- if (tgetent(tcbuf,term) != 1) {
- (void) fprintf(stderr,"Can't get termcap entry for terminal [%s]\n", term);
- } else {
- ! termcap_get(&tcap_normal, "se");
- ! termcap_get(&tcap_boldface, "md");
- ! termcap_get(&tcap_underline, "us");
- ! termcap_get(&tcap_reverse, "so");
- tcl_normal = strlen(tcap_normal);
- tcl_bold = strlen(tcap_boldface);
- tcl_uline = strlen(tcap_underline);
- tcl_rev = strlen(tcap_reverse);
- }
- +
- } /* termcap_init */
-
-
- ***************
- *** 1026,1028 ****
- --- 1039,1042 ----
- #endif /* CURSES */
-
- /* eof main.c */
- +
- diff -c ./main.h ../ncftp151/main.h
- *** ./main.h Tue Aug 24 16:33:43 1993
- --- ../ncftp151/main.h Sun Aug 29 21:47:39 1993
- ***************
- *** 33,39 ****
- #ifdef CURSES
- void tcap_put(char *cap);
- void termcap_init(void);
- ! void termcap_get(char *dest, char *attr);
- #ifdef NO_CONST
- extern char *tgetstr(char *, char **);
- #else
- --- 33,39 ----
- #ifdef CURSES
- void tcap_put(char *cap);
- void termcap_init(void);
- ! void termcap_get(char **dest, char *attr);
- #ifdef NO_CONST
- extern char *tgetstr(char *, char **);
- #else
- diff -c ./ncftp.1 ../ncftp151/ncftp.1
- *** ./ncftp.1 Tue Aug 24 16:33:43 1993
- --- ../ncftp151/ncftp.1 Sun Aug 29 21:47:39 1993
- ***************
- *** 148,154 ****
- names to be abbreviated.
- .PP
- For each commonly accessed site, you can put an entry in your program
- ! preferences file (let's call it the ``ncftprc file.''or ``RC file.''for short).
- To open the site, from the command shell all you do is type:
- .Ds
- open wuarchive.wustl.edu
- --- 148,154 ----
- names to be abbreviated.
- .PP
- For each commonly accessed site, you can put an entry in your program
- ! preferences file (let's call it the ``ncftprc file'' or ``RC file'' for short).
- To open the site, from the command shell all you do is type:
- .Ds
- open wuarchive.wustl.edu
- ***************
- *** 226,232 ****
- Login Name (mgleason):
- .De
- .PP
- ! I could just hit return to tell the program that I want ``mgleason.''as my
- username, then I would enter my password.
- .\"-------
- .SH "Format of the RC file"
- --- 226,232 ----
- Login Name (mgleason):
- .De
- .PP
- ! I could just hit return to tell the program that I want ``mgleason'' as my
- username, then I would enter my password.
- .\"-------
- .SH "Format of the RC file"
- ***************
- *** 240,249 ****
- use a new format, so don't invest too much time in it.
- .PP
- The RC file can be named
- ! .RB `` ncftprc ,''
- ! .RB `` netrc ,''
- or
- ! .RB `` .ncftprc ,''
- but it is usually named
- .RB `` .netrc ''
- so it can be used with the stock
- --- 240,249 ----
- use a new format, so don't invest too much time in it.
- .PP
- The RC file can be named
- ! .RB `` ncftprc '',
- ! .RB `` netrc '',
- or
- ! .RB `` .ncftprc '',
- but it is usually named
- .RB `` .netrc ''
- so it can be used with the stock
- ***************
- *** 260,266 ****
- .I #unset
- commands that do things
- to the programs variables.
- ! The reason for the ``#.''is so the stock
- .I ftp
- program will think they are comments.
- You might have this appearing as
- --- 260,266 ----
- .I #unset
- commands that do things
- to the programs variables.
- ! The reason for the ``#'' is so the stock
- .I ftp
- program will think they are comments.
- You might have this appearing as
- ***************
- *** 315,321 ****
- .De
- .PP
- Of course, if all you want to do is open wuarchive anonymously, you
- ! needn't bother with the ``user,.''``password,.''and ``account.''lines.
- You may want to put them in if you plan on using the stock
- .I ftp
- program, though.
- --- 315,321 ----
- .De
- .PP
- Of course, if all you want to do is open wuarchive anonymously, you
- ! needn't bother with the ``user'', ``password'', and ``account'' lines.
- You may want to put them in if you plan on using the stock
- .I ftp
- program, though.
- ***************
- *** 480,493 ****
- csh> head README
- .De
- .PP
- ! This tells your shell, in this case the ``c-shell.''to run
- .IR NcFTP ,
- which
- would open wuarchive, fetch
- ! .B /pub/README
- and write the file
- .B ./README
- ! in the your current working directory, and then exits.
- This is nice if you don't
- want to browse around the remote site, and you know exactly want you want.
- It would also come in handy in shell scripts, where you don't want to
- --- 480,493 ----
- csh> head README
- .De
- .PP
- ! This tells your shell, in this case the ``c-shell'' to run
- .IR NcFTP ,
- which
- would open wuarchive, fetch
- ! .B /graphics/gif/README
- and write the file
- .B ./README
- ! in the current working directory, and then exits.
- This is nice if you don't
- want to browse around the remote site, and you know exactly want you want.
- It would also come in handy in shell scripts, where you don't want to
- ***************
- *** 635,641 ****
- empty string.
- .PP
- You can use any of those three commands in both the command shell,
- ! or in the RC file with a ``#.''prepended.
- .\"-------
- .SH "Program variables"
- .\"-------
- --- 635,641 ----
- empty string.
- .PP
- You can use any of those three commands in both the command shell,
- ! or in the RC file with a ``#'' prepended.
- .\"-------
- .SH "Program variables"
- .\"-------
- ***************
- *** 649,655 ****
- (you can also use
- .RB `` 1 ''
- or
- ! .RB `` 0 .''.
- .TP
- Integer:
- Can be any positive or negative number, or
- --- 649,655 ----
- (you can also use
- .RB `` 1 ''
- or
- ! .RB `` 0 '').
- .TP
- Integer:
- Can be any positive or negative number, or
- ***************
- *** 753,759 ****
- such as
- .RB `` binary ''
- or
- ! .RB `` ascii .''
- .TP
- .IR verbose " (String/Integer)"
- Controls the amount of output spewed by the program.
- --- 753,759 ----
- such as
- .RB `` binary ''
- or
- ! .RB `` ascii ''.
- .TP
- .IR verbose " (String/Integer)"
- Controls the amount of output spewed by the program.
- ***************
- *** 787,793 ****
- .PP
- The
- .I ls
- ! command sends the FTP command ``NLST.''for you.
- This command has been set so that it defaults
- to always listing files in columns (this is the
- .B \-C
- --- 787,793 ----
- .PP
- The
- .I ls
- ! command sends the FTP command ``NLST'' for you.
- This command has been set so that it defaults
- to always listing files in columns (this is the
- .B \-C
- ***************
- *** 807,813 ****
- .PP
- The
- .I dir
- ! command sends the FTP command ``LIST.''for you, which instead
- of printing just item names, it prints item sizes, owners, dates, and
- permissions as well.
- This command is equivalent to
- --- 807,813 ----
- .PP
- The
- .I dir
- ! command sends the FTP command ``LIST'' for you, which instead
- of printing just item names, it prints item sizes, owners, dates, and
- permissions as well.
- This command is equivalent to
- ***************
- *** 974,982 ****
- I call it ``Poor Man's File Completion.''
- If you've done a remote listing, and you decide you want to download a
- file by the name of
- ! .RB `` obnoxiouslylongpackagename.tar.Z ,''
- you can use
- ! ``PMFC.''to save some keystrokes.
- Choose an expression that will only
- match that one file, then use it with
- .IR get :
- --- 974,982 ----
- I call it ``Poor Man's File Completion.''
- If you've done a remote listing, and you decide you want to download a
- file by the name of
- ! .RB `` obnoxiouslylongpackagename.tar.Z '',
- you can use
- ! ``PMFC'' to save some keystrokes.
- Choose an expression that will only
- match that one file, then use it with
- .IR get :
- ***************
- *** 1021,1027 ****
- .De
- .PP
- instead.
- ! The ``m.''commands will verify each file,
- if you have the program variable
- .I mprompt
- set.
- --- 1021,1027 ----
- .De
- .PP
- instead.
- ! The ``m'' commands will verify each file,
- if you have the program variable
- .I mprompt
- set.
- ***************
- *** 1040,1046 ****
- page README.Z
- .De
- .PP
- ! The second example show that you can use ``PMFC.''like you can for
- .IR get.
- The third example will work also, because if the program knows how to
- decompress the file, it will do so before feeding it to your pager.
- --- 1040,1046 ----
- page README.Z
- .De
- .PP
- ! The second example show that you can use ``PMFC'' like you can for
- .IR get.
- The third example will work also, because if the program knows how to
- decompress the file, it will do so before feeding it to your pager.
- ***************
- *** 1073,1079 ****
- lookup cse.unl.edu
- .De
- .PP
- ! This would spit out IP number for that site, in this case ``129.93.1.12.''
- If you needed to know what a site's name was, but only knew the IP number,
- try:
- .Ds
- --- 1073,1079 ----
- lookup cse.unl.edu
- .De
- .PP
- ! This would spit out IP number for that site, in this case ``129.93.1.12''.
- If you needed to know what a site's name was, but only knew the IP number,
- try:
- .Ds
- ***************
- *** 1080,1086 ****
- lookup 129.93.1.12
- .De
- .PP
- ! This would spit out the name for that site, in this case ``cse.unl.edu.''
- .\"-------
- .SH "Checking the configuration of the program"
- .\"-------
- --- 1080,1086 ----
- lookup 129.93.1.12
- .De
- .PP
- ! This would spit out the name for that site, in this case ``cse.unl.edu''.
- .\"-------
- .SH "Checking the configuration of the program"
- .\"-------
- ***************
- *** 1111,1117 ****
- You can check the
- .I version
- command to see if either
- ! ``GETLINE.''or ``READLINE.''are installed.
- .\"-------
- .SH "Customizing the prompt"
- .\"-------
- --- 1111,1117 ----
- You can check the
- .I version
- command to see if either
- ! ``GETLINE'' or ``READLINE'' are installed.
- .\"-------
- .SH "Customizing the prompt"
- .\"-------
- ***************
- *** 1162,1171 ****
- directory path in
- .I "colon-mode"
- format, such as
- ! ``cse.unl.edu:/pub/mgleason,.''or ``(not connected).''
- The
- .B @c
- ! flag is similar, only it will insert ``cse.unl.edu:/pub/mgleason.''and a
- newline if connected, otherwise it prints nothing.
- The default prompt uses
- this flag to print a two line prompt when connected and a one line prompt
- --- 1162,1171 ----
- directory path in
- .I "colon-mode"
- format, such as
- ! ``cse.unl.edu:/pub/mgleason'', or ``(not connected)''.
- The
- .B @c
- ! flag is similar, only it will insert ``cse.unl.edu:/pub/mgleason'' and a
- newline if connected, otherwise it prints nothing.
- The default prompt uses
- this flag to print a two line prompt when connected and a one line prompt
- ***************
- *** 1175,1181 ****
- inserts the event number (how many commands you've typed).
- .PP
- .B @M
- ! inserts ``(Mail)\0.''if mail has arrived since running the program.
- .PP
- .B @N
- inserts a newline character.
- --- 1175,1181 ----
- inserts the event number (how many commands you've typed).
- .PP
- .B @M
- ! inserts ``(Mail)\0'' if mail has arrived since running the program.
- .PP
- .B @N
- inserts a newline character.
- ***************
- *** 1235,1246 ****
- .TP
- .B \-I
- toggles the mprompt variable; this is provided for compatibility with
- ! .RB `` "ftp \-i" .''
- .TP
- .B \-N
- disables reading of the RC file;
- this is provided for compatibility with
- ! .RB `` "ftp \-n" .''
- .TP
- .BI \-V " x"
- sets verbosity to level
- --- 1235,1246 ----
- .TP
- .B \-I
- toggles the mprompt variable; this is provided for compatibility with
- ! .RB `` "ftp \-i" ''.
- .TP
- .B \-N
- disables reading of the RC file;
- this is provided for compatibility with
- ! .RB `` "ftp \-n" ''.
- .TP
- .BI \-V " x"
- sets verbosity to level
- ***************
- *** 1273,1288 ****
- .De
- .PP
- This fetches
- ! .B README
- and then quits:
- .Ds
- ! csh> ncftp ftp.unl.edu:/pub/README
- .De
- .PP
- Some others examples, with open options and main program options mixed in:
- .Ds
- csh> ncftp \-V quiet \-u ftp.unl.edu
- ! csh> ncftp \-c ftp.unl.edu:/pub/README
- csh> ncftp \-D 2 \-r \-d 120 \-g 10 \-N ftp.unl.edu
- .De
- .\"-------
- --- 1273,1288 ----
- .De
- .PP
- This fetches
- ! .B CONTENTS
- and then quits:
- .Ds
- ! csh> ncftp cse.unl.edu:/pub/mgleason/CONTENTS
- .De
- .PP
- Some others examples, with open options and main program options mixed in:
- .Ds
- csh> ncftp \-V quiet \-u ftp.unl.edu
- ! csh> ncftp \-c cse.unl.edu:/pub/mgleason/CONTENTS
- csh> ncftp \-D 2 \-r \-d 120 \-g 10 \-N ftp.unl.edu
- .De
- .\"-------
- ***************
- *** 1321,1327 ****
- # If an antiquated non-UNIX machine doesn't use
- # the "SYST" command, you may need to unset
- # remote\-is\-unix, if the remote host complains
- ! # about ``ls \-CF.''
- machine some.vms.unl.edu
- macdef init
- unset remote\-is\-unix
- --- 1321,1327 ----
- # If an antiquated non-UNIX machine doesn't use
- # the "SYST" command, you may need to unset
- # remote\-is\-unix, if the remote host complains
- ! # about ``ls \-CF''.
- machine some.vms.unl.edu
- macdef init
- unset remote\-is\-unix
- diff -c ./open.c ../ncftp151/open.c
- *** ./open.c Tue Aug 24 16:33:43 1993
- --- ../ncftp151/open.c Sun Aug 29 21:47:39 1993
- ***************
- *** 436,449 ****
- char *user, *pass, *acct;
- int login_verbosity;
-
- - /* If there is already a site open, close that one so we can
- - * open a new one.
- - */
- - if (connected && NOT_VQUIET && hostname[0]) {
- - (void) printf("Closing %s...\n", hostname);
- - (void) disconnect(0, NULL);
- - }
- -
- ruser = rpass = racct = NULL;
- /* This also loads the init macro. */
- siteInRC = ruserpass2(openopt->hostname, &ruser, &rpass, &racct);
- --- 436,441 ----
- ***************
- *** 584,589 ****
- --- 576,589 ----
- int cmdOpen(int argc, char **argv)
- {
- OpenOptions openopt;
- +
- + /* If there is already a site open, close that one so we can
- + * open a new one.
- + */
- + if (connected && NOT_VQUIET && hostname[0]) {
- + (void) printf("Closing %s...\n", hostname);
- + (void) disconnect(0, NULL);
- + }
-
- if ((GetOpenOptions(argc, argv, &openopt) == USAGE) ||
- (Open(&openopt) == USAGE))
- diff -c ./patchlevel.h ../ncftp151/patchlevel.h
- *** ./patchlevel.h Tue Aug 24 16:33:43 1993
- --- ../ncftp151/patchlevel.h Sun Aug 29 21:57:39 1993
- ***************
- *** 43,49 ****
- * shouldn't. Fixed bug in macdef. Fixed small bug in getreply. Turned
- * off echoing during the progress-meter. Added syslogging capability.
- *
- ! * v1.4.0 - Summer 1993, not finished yet.
- * Fixed error in CONST block in ftpdefs.h. Fixed error in sys.h so that when
- * you compile with -DGETPASS it uses getpass. 'ls' bug with wildcards
- * fixed. 'ls' enhanced to take multiple remote paths. Added new cpp symbol
- --- 43,49 ----
- * shouldn't. Fixed bug in macdef. Fixed small bug in getreply. Turned
- * off echoing during the progress-meter. Added syslogging capability.
- *
- ! * v1.5.0 - August 22, 1993
- * Fixed error in CONST block in ftpdefs.h. Fixed error in sys.h so that when
- * you compile with -DGETPASS it uses getpass. 'ls' bug with wildcards
- * fixed. 'ls' enhanced to take multiple remote paths. Added new cpp symbol
- ***************
- *** 101,104 ****
- --- 101,114 ----
- * open.{c,h} dedicated to it; broke up setpeer into smaller sub-procs,
- * and commented whole file (yay!). Added a new user var, anon-open,
- * for those folks who don't want anon logins as the default.
- + *
- + * v1.5.1 - August 29, 1993
- + * Bugs fixed in termcap code, mput, and pwd. No longer adding blank
- + * lines to readline's history. Netrc site abbreviations were matched
- + * by strncmp() when it should have been strstr(). Bug fixed in
- + * open's site "menu." Revised tips a little to encourage .ncftprc instead
- + * of .netrc. TRY_ABOR documented in the README. Added stuff to the
- + * DYNIX entry. Hacks added for SCO322. Shortened bargraph prog meter
- + * by one char. Better compat with getline. Man page fixed by DWS again :)
- */
- +
- diff -c ./sys.h ../ncftp151/sys.h
- *** ./sys.h Tue Aug 24 16:33:43 1993
- --- ../ncftp151/sys.h Sun Aug 29 21:47:41 1993
- ***************
- *** 56,61 ****
- --- 56,66 ----
- # define SYSSELECTH 1
- #endif /* _AIX */
-
- + #ifdef SCO322
- + # define BOTCHED_FOPEN_RW
- + # define SCO324
- + #endif
- +
- #ifdef SCO324
- # define System "SCO Unix"
- # ifndef SYSV
- ***************
- *** 115,123 ****
- --- 120,135 ----
- # ifndef SGTTYB
- # define SGTTYB 1
- # endif
- + # ifndef NO_UTIMEH
- + # define NO_UTIMEH 1
- + # endif
- # ifndef NO_STDLIBH
- # define NO_STDLIBH 1
- # endif
- + # ifndef NO_VARARGS
- + # define NO_VARARGS 1
- + # endif
- + # include <sys/types.h>
- #endif /* DYNIX */
-
- #ifdef ultrix
- diff -c ./tips.c ../ncftp151/tips.c
- *** ./tips.c Tue Aug 24 16:33:43 1993
- --- ../ncftp151/tips.c Sun Aug 29 21:47:41 1993
- ***************
- *** 24,30 ****
- "Have you tried typing 'open' by itself lately?",
-
- "If you don't want a .ncrecent file in your home directory, put the \n\
- ! command '#unset recent-list' in your .netrc/.ncftprc file.",
-
- "pseudo-filename-completion is supported in some commands. To use it,\n\
- use a wildcard expression that will match exactly one file. I.e., if you\n\
- --- 24,30 ----
- "Have you tried typing 'open' by itself lately?",
-
- "If you don't want a .ncrecent file in your home directory, put the \n\
- ! command '#unset recent-list' in your .ncftprc file.",
-
- "pseudo-filename-completion is supported in some commands. To use it,\n\
- use a wildcard expression that will match exactly one file. I.e., if you\n\
- ***************
- *** 32,46 ****
- you can't use the cd command with this feature (yet).",
-
- "You don't need to type the exact site name with open. If a site is in\n\
- ! your .netrc/.ncftprc or the recent-list (.ncrecent), just type a unique\n\
- abbreviation (substring really). I.e. 'open wuar' if you have the site\n\
- ! wuarchive.wustl.edu in your rc or recent-list.",
-
- ! "You can put set commands in your .netrc/.ncftprc, by adding lines such\n\
- as '#set local-dir /usr/tmp' to the file, which will be run at startup.",
-
- ! "Abuse the power of the .netrc! Put in entries for your favorite sites.\n\
- ! Sample .netrc (or .ncftprc):\n\
- #set pager \"less -M\"\n\
- \n\
- machine wuarchive.wustl.edu\n\
- --- 32,47 ----
- you can't use the cd command with this feature (yet).",
-
- "You don't need to type the exact site name with open. If a site is in\n\
- ! your .ncftprc or the recent-file (.ncrecent), just type a unique\n\
- abbreviation (substring really). I.e. 'open wuar' if you have the site\n\
- ! wuarchive.wustl.edu in your rc or recent-file.",
-
- ! "You can put set commands in your .ncftprc, by adding lines such\n\
- as '#set local-dir /usr/tmp' to the file, which will be run at startup.",
-
- ! "Use the .ncftprc file to set variables at startup and to add sites that \n\
- ! need init macros.\n\
- ! Sample .ncftprc:\n\
- #set pager \"less -M\"\n\
- \n\
- machine wuarchive.wustl.edu\n\
- ***************
- *** 53,60 ****
- "If you want to keep your .netrc's for ftp and ncftp separate, name\n\
- ncftp's rc to .ncftprc.",
-
- ! "Type 'open' by itself to get a list of the sites in your recent-list and\n\
- ! your .netrc. You can then supply '#5' at the prompt, or use 'open #5'\n\
- later.",
-
- "Colon-mode is a quick way to get a file from your shell. Try something\n\
- --- 54,61 ----
- "If you want to keep your .netrc's for ftp and ncftp separate, name\n\
- ncftp's rc to .ncftprc.",
-
- ! "Type 'open' by itself to get a list of the sites in your recent-file and\n\
- ! your .ncftprc. You can then supply '#5' at the prompt, or use 'open #5'\n\
- later.",
-
- "Colon-mode is a quick way to get a file from your shell. Try something\n\
- ***************
- *** 104,110 ****
- output of the 'version' command in your message. An easy way to do that\n\
- is to compose your message, then do a 'ncftp -H >> msg.'",
-
- ! "Sick and tired of these tips? Put '#unset tips' in your .netrc/.ncftprc."
- };
-
- /* Not another dinky header, por favor. */
- --- 105,115 ----
- output of the 'version' command in your message. An easy way to do that\n\
- is to compose your message, then do a 'ncftp -H >> msg.'",
-
- ! "Don't put a site in your .ncftprc unless you want an 'init' macro. The \n\
- ! recent-file saves sites with the last directory you were in, unlike \n\
- ! the rc file, while still letting you use sitename abbreviations."
- !
- ! "Sick and tired of these tips? Put '#unset tips' in your .ncftprc."
- };
-
- /* Not another dinky header, por favor. */
- diff -c ./util.c ../ncftp151/util.c
- *** ./util.c Tue Aug 24 16:33:43 1993
- --- ../ncftp151/util.c Sun Aug 29 21:47:41 1993
- ***************
- *** 395,401 ****
- * to scan the prompt for all escape sequences.
- */
- /*ARGSUSED*/
- ! static int MainPromptLen(char *pr)
- {
- return (int)epromptlen;
- }
- --- 395,401 ----
- * to scan the prompt for all escape sequences.
- */
- /*ARGSUSED*/
- ! static size_t MainPromptLen(char *pr)
- {
- return (int)epromptlen;
- }
- ***************
- *** 454,460 ****
- (void) _Strncpy(sline, cp, size);
- free(cp);
- (void) RemoveTrailingNewline(cp = sline, NULL);
- ! add_history(cp);
- }
- #else /* READLINE */
-
- --- 454,461 ----
- (void) _Strncpy(sline, cp, size);
- free(cp);
- (void) RemoveTrailingNewline(cp = sline, NULL);
- ! if (*cp != 0) /* Don't add blank lines to history buffer. */
- ! add_history(cp);
- }
- #else /* READLINE */
-
- ***************
- *** 464,477 ****
- gl_strwidth(MainPromptLen);
- if ((cp = getline(promptstr)) != NULL) {
- (void) _Strncpy(sline, cp, size);
- ! if (!*cp) {
- ! cp = NULL;
- ! } else {
- gl_histadd(cp);
- cp = sline;
- }
- }
- ! gl_strwidth((int (*)(char *)) strlen);
- } else {
- #ifdef CURSES
- tcap_put(promptstr);
- --- 465,477 ----
- gl_strwidth(MainPromptLen);
- if ((cp = getline(promptstr)) != NULL) {
- (void) _Strncpy(sline, cp, size);
- ! if (*cp != 0) { /* Don't add blank lines to history buffer. */
- gl_histadd(cp);
- cp = sline;
- }
- }
- ! /* Hope your strlen is declared as returning a size_t. */
- ! gl_strwidth(strlen);
- } else {
- #ifdef CURSES
- tcap_put(promptstr);
- --
- ______________________________________________________________________________
- mike gleason mgleason@cse.unl.edu NCEMRSoft, baby!
-
- exit 0 # Just in case...
-