summaryrefslogtreecommitdiffstats
path: root/contrib/less/main.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2002-01-07 20:37:09 +0000
committerps <ps@FreeBSD.org>2002-01-07 20:37:09 +0000
commitbeaaa84fd0e7d42986a94208748065f685e9d6fe (patch)
tree20612717e5ecd1a4dbd5dd8b2498580eaaeb1fee /contrib/less/main.c
parent1c0805000f77e569bd5ec950432de68a3854137a (diff)
downloadFreeBSD-src-beaaa84fd0e7d42986a94208748065f685e9d6fe.zip
FreeBSD-src-beaaa84fd0e7d42986a94208748065f685e9d6fe.tar.gz
Merge vendor changes onto mainline.
Diffstat (limited to 'contrib/less/main.c')
-rw-r--r--contrib/less/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/less/main.c b/contrib/less/main.c
index 9f5e1c3..d1a73a4 100644
--- a/contrib/less/main.c
+++ b/contrib/less/main.c
@@ -15,6 +15,9 @@
*/
#include "less.h"
+#if MSDOS_COMPILER==WIN32C
+#include <windows.h>
+#endif
public char * every_first_cmd = NULL;
public int new_file;
@@ -44,10 +47,15 @@ public char * editproto;
#endif
#if TAGS
+extern char * tags;
extern char * tagoption;
extern int jump_sline;
#endif
+#ifdef WIN32
+static char consoleTitle[256];
+#endif
+
extern int missing_cap;
extern int know_dumb;
@@ -96,6 +104,7 @@ main(argc, argv)
putenv(env);
}
}
+ GetConsoleTitle(consoleTitle, sizeof(consoleTitle)/sizeof(char));
#endif /* WIN32 */
/*
@@ -168,7 +177,7 @@ main(argc, argv)
ifile = get_ifile(FAKE_HELPFILE, ifile);
while (argc-- > 0)
{
-#if (MSDOS_COMPILER && MSDOS_COMPILER != DJGPPC) || OS2
+#if (MSDOS_COMPILER && MSDOS_COMPILER != DJGPPC)
/*
* Because the "shell" doesn't expand filename patterns,
* treat each argument as a filename pattern rather than
@@ -224,7 +233,7 @@ main(argc, argv)
* Select the first file to examine.
*/
#if TAGS
- if (tagoption != NULL)
+ if (tagoption != NULL || strcmp(tags, "-") == 0)
{
/*
* A -t option was given.
@@ -380,6 +389,9 @@ quit(status)
*/
close(2);
#endif
+#if WIN32
+ SetConsoleTitle(consoleTitle);
+#endif
close_getchr();
exit(status);
}
OpenPOWER on IntegriCloud