summaryrefslogtreecommitdiffstats
path: root/contrib/less/main.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-04-17 07:24:09 +0000
committertjr <tjr@FreeBSD.org>2004-04-17 07:24:09 +0000
commit2dd9648c3e63b5984fd45b9a7a38158b7f813920 (patch)
tree4fefa15c12f7b1396b087d2cc571bd936cba7fa4 /contrib/less/main.c
parent8253204c1a034cf4aefb77f7fff7979258999859 (diff)
downloadFreeBSD-src-2dd9648c3e63b5984fd45b9a7a38158b7f813920.zip
FreeBSD-src-2dd9648c3e63b5984fd45b9a7a38158b7f813920.tar.gz
Merge vendor changes onto mainline.
Diffstat (limited to 'contrib/less/main.c')
-rw-r--r--contrib/less/main.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/contrib/less/main.c b/contrib/less/main.c
index d1a73a4..18353db 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);
}
/*
OpenPOWER on IntegriCloud