diff options
Diffstat (limited to 'contrib/less/main.c')
-rw-r--r-- | contrib/less/main.c | 16 |
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); } |