diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2004-04-17 07:24:09 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2004-04-17 07:24:09 +0000 |
commit | 1ede1615747861739301dfdbb525338ceacb5183 (patch) | |
tree | 4fefa15c12f7b1396b087d2cc571bd936cba7fa4 /contrib/less/main.c | |
parent | d9872da232e14e1a92707c29e1f833346a03af92 (diff) | |
download | src-1ede1615747861739301dfdbb525338ceacb5183.tar.gz src-1ede1615747861739301dfdbb525338ceacb5183.zip |
Merge vendor changes onto mainline.
Notes
Notes:
svn path=/head/; revision=128348
Diffstat (limited to 'contrib/less/main.c')
-rw-r--r-- | contrib/less/main.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/contrib/less/main.c b/contrib/less/main.c index d1a73a405865..18353db36b67 100644 --- a/contrib/less/main.c +++ b/contrib/less/main.c @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2000 Mark Nudelman + * Copyright (C) 1984-2002 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -177,6 +177,7 @@ main(argc, argv) ifile = get_ifile(FAKE_HELPFILE, ifile); while (argc-- > 0) { + char *filename; #if (MSDOS_COMPILER && MSDOS_COMPILER != DJGPPC) /* * Because the "shell" doesn't expand filename patterns, @@ -186,16 +187,23 @@ main(argc, argv) */ struct textlist tlist; char *gfilename; - char *filename; gfilename = lglob(*argv++); init_textlist(&tlist, gfilename); filename = NULL; while ((filename = forw_textlist(&tlist, filename)) != NULL) - ifile = get_ifile(filename, ifile); + { + (void) get_ifile(filename, ifile); + ifile = prev_ifile(NULL_IFILE); + } free(gfilename); #else - ifile = get_ifile(*argv++, ifile); + filename = shell_quote(*argv); + if (filename == NULL) + filename = *argv; + argv++; + (void) get_ifile(filename, ifile); + ifile = prev_ifile(NULL_IFILE); #endif } /* @@ -224,11 +232,10 @@ main(argc, argv) if (missing_cap && !know_dumb && !more_mode) error("WARNING: terminal is not fully functional", NULL_PARG); init_mark(); - raw_mode(1); open_getchr(); + raw_mode(1); init_signals(1); - /* * Select the first file to examine. */ @@ -273,6 +280,7 @@ main(argc, argv) commands(); quit(QUIT_OK); /*NOTREACHED*/ + return (0); } /* @@ -307,6 +315,7 @@ ecalloc(count, size) error("Cannot allocate memory", NULL_PARG); quit(QUIT_ERROR); /*NOTREACHED*/ + return (NULL); } /* |