aboutsummaryrefslogtreecommitdiff
path: root/contrib/less/main.c
diff options
context:
space:
mode:
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 2c69d877592c..861996bd3836 100644
--- a/contrib/less/main.c
+++ b/contrib/less/main.c
@@ -14,6 +14,9 @@
*/
#include "less.h"
+#if MSDOS_COMPILER==WIN32C
+#include <windows.h>
+#endif
public char * every_first_cmd = NULL;
public int new_file;
@@ -42,10 +45,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;
@@ -93,6 +101,7 @@ main(argc, argv)
putenv(env);
}
}
+ GetConsoleTitle(consoleTitle, sizeof(consoleTitle)/sizeof(char));
#endif /* WIN32 */
/*
@@ -153,7 +162,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
@@ -209,7 +218,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.
@@ -365,6 +374,9 @@ quit(status)
*/
close(2);
#endif
+#if WIN32
+ SetConsoleTitle(consoleTitle);
+#endif
close_getchr();
exit(status);
}