home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 22 gnu
/
22-gnu.zip
/
less2912.zip
/
patches.os2
< prev
next >
Wrap
Text File
|
1995-11-09
|
49KB
|
1,925 lines
Only in new: zfiles.c
diff -cbr orig/ch.c new/ch.c
*** orig/ch.c Thu Nov 09 10:35:26 1995
--- new/ch.c Mon Apr 10 10:05:52 1995
***************
*** 707,713 ****
* But don't really close it if it was opened via popen(),
* because pclose() wants to close it.
*/
! if (!(ch_flags & CH_POPENED))
close(ch_file);
ch_file = -1;
} else
--- 707,715 ----
* But don't really close it if it was opened via popen(),
* because pclose() wants to close it.
*/
! if (ch_flags & CH_COMPRESSED)
! Zclose(ch_file);
! else if (!(ch_flags & CH_POPENED))
close(ch_file);
ch_file = -1;
} else
diff -cbr orig/charset.c new/charset.c
*** orig/charset.c Wed Feb 01 01:55:28 1995
--- new/charset.c Thu Nov 09 10:36:38 1995
***************
*** 211,229 ****
{
register char *s;
! s = getenv("LESSBINFMT");
setbinfmt(s);
/*
* See if environment variable LESSCHARSET is defined.
*/
! s = getenv("LESSCHARSET");
if (icharset(s))
return;
/*
* LESSCHARSET is not defined: try LESSCHARDEF.
*/
! s = getenv("LESSCHARDEF");
if (s != NULL && *s != '\0')
{
ichardef(s);
--- 211,229 ----
{
register char *s;
! s = lgetenv("LESSBINFMT");
setbinfmt(s);
/*
* See if environment variable LESSCHARSET is defined.
*/
! s = lgetenv("LESSCHARSET");
if (icharset(s))
return;
/*
* LESSCHARSET is not defined: try LESSCHARDEF.
*/
! s = lgetenv("LESSCHARDEF");
if (s != NULL && *s != '\0')
{
ichardef(s);
diff -cbr orig/cmd.h new/cmd.h
*** orig/cmd.h Wed Feb 01 01:55:28 1995
--- new/cmd.h Thu Nov 09 10:36:38 1995
***************
*** 115,117 ****
--- 115,119 ----
#define EC_NOHISTORY 02
#define EC_NOCOMPLETE 04
+ /* Environment variable stuff */
+ #define EV_OK 01
diff -cbr orig/decode.c new/decode.c
*** orig/decode.c Thu Mar 09 00:04:14 1995
--- new/decode.c Thu Nov 09 10:36:40 1995
***************
*** 195,200 ****
--- 195,201 ----
*/
static struct tablelist *list_fcmd_tables = NULL;
static struct tablelist *list_ecmd_tables = NULL;
+ static struct tablelist *list_var_tables = NULL;
/*
***************
*** 208,214 ****
*/
add_fcmd_table((char*)cmdtable, sizeof(cmdtable));
add_ecmd_table((char*)edittable, sizeof(edittable));
- get_editkeys();
#if USERFILE
/*
* Try to add the tables in the standard lesskey file "$HOME/.less".
--- 209,214 ----
***************
*** 271,276 ****
--- 271,318 ----
}
/*
+ * Insert a command table in the proper place - after default, but before
+ * any .less file table.
+ */
+ public void
+ insert_fcmd_table(buf, len)
+ char *buf;
+ int len;
+ {
+ if (list_fcmd_tables == NULL || list_fcmd_tables->t_next == NULL)
+ add_fcmd_table(buf,len);
+ else if (add_cmd_table(&(list_fcmd_tables->t_next), buf, len) < 0)
+ error("Warning: some commands may be disabled", NULL_PARG);
+ }
+
+ /*
+ * Insert an editing command table in the proper place - after default, but
+ * before any .less file table.
+ */
+ public void
+ insert_ecmd_table(buf, len)
+ char *buf;
+ int len;
+ {
+ if (list_ecmd_tables == NULL || list_ecmd_tables->t_next == NULL)
+ add_ecmd_table(buf,len);
+ else if (add_cmd_table(&(list_ecmd_tables->t_next), buf, len) < 0)
+ error("Warning: some edit commands may be disabled", NULL_PARG);
+ }
+
+ /*
+ * Add an environment variable table.
+ */
+ public void
+ add_var_table(buf, len)
+ char *buf;
+ int len;
+ {
+ if (add_cmd_table(&list_var_tables, buf, len) < 0)
+ error("Warning: environment variables from lesskey file unavailable", NULL_PARG);
+ }
+
+ /*
* Search a single command table for the command string in cmd.
*/
public int
***************
*** 403,409 ****
--- 445,473 ----
return (cmd_decode(list_ecmd_tables, cmd, sp));
}
+ /*
+ * Get the value of an environment variable.
+ * Looks first in the lesskey file, then in the real environment.
+ */
+ public char *
+ lgetenv(var)
+ char *var;
+ {
+ int a;
+ char *s;
+
+ a = cmd_decode(list_var_tables, var, &s);
+ if (a == EV_OK)
+ return (s);
+ return (getenv(var));
+ }
+
#if USERFILE
+ /*
+ * Get an "integer" from a lesskey file.
+ * Integers are stored in a funny format:
+ * two bytes, low order first, in radix KRADIX.
+ */
static int
gint(sp)
char **sp;
***************
*** 415,420 ****
--- 479,487 ----
return (n);
}
+ /*
+ * Process an old (pre-v241) lesskey file.
+ */
static int
old_lesskey(buf, len)
char *buf;
***************
*** 433,438 ****
--- 500,508 ----
return (0);
}
+ /*
+ * Process a new (post-v241) lesskey file.
+ */
static int
new_lesskey(buf, len)
char *buf;
***************
*** 440,446 ****
{
char *p;
register int c;
- register int done;
register int n;
/*
--- 510,515 ----
***************
*** 452,459 ****
buf[len-1] != C2_END_LESSKEY_MAGIC)
return (-1);
p = buf + 4;
! done = 0;
! while (!done)
{
c = *p++;
switch (c)
--- 521,527 ----
buf[len-1] != C2_END_LESSKEY_MAGIC)
return (-1);
p = buf + 4;
! for (;;)
{
c = *p++;
switch (c)
***************
*** 468,482 ****
add_ecmd_table(p, n);
p += n;
break;
! case END_SECTION:
! done = 1;
break;
default:
! free(buf);
return (-1);
}
}
- return (0);
}
/*
--- 536,555 ----
add_ecmd_table(p, n);
p += n;
break;
! case VAR_SECTION:
! n = gint(&p);
! add_var_table(p, n);
! p += n;
break;
+ case END_SECTION:
+ return (0);
default:
! /*
! * Unrecognized section type.
! */
return (-1);
}
}
}
/*
***************
*** 641,647 ****
* This does NOT include the original character that was
* passed in as a parameter.
*/
! while (nch > 1) {
ungetcc(usercmd[--nch]);
}
} else
--- 714,721 ----
* This does NOT include the original character that was
* passed in as a parameter.
*/
! while (nch > 1)
! {
ungetcc(usercmd[--nch]);
}
} else
diff -cbr orig/defines.dos new/defines.dos
*** orig/defines.dos Fri Feb 24 22:25:42 1995
--- new/defines.dos Thu Nov 09 10:36:40 1995
***************
*** 195,213 ****
#define HAVE_VOID 1
/* Define HAVE_TIME_T if your system supports the "time_t" type. */
! #define HAVE_TIME_T 0
/* Define HAVE_STRERROR if you have the strerror() function. */
! #define HAVE_STRERROR 0
/* Define HAVE_FILENO if you have the fileno() macro. */
! #define HAVE_FILENO 0
/* Define HAVE_ERRNO if you have the errno variable */
#define HAVE_ERRNO 0
/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
! #define HAVE_SYS_ERRLIST 0
/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
#define HAVE_OSPEED 0
--- 195,213 ----
#define HAVE_VOID 1
/* Define HAVE_TIME_T if your system supports the "time_t" type. */
! #define HAVE_TIME_T 1
/* Define HAVE_STRERROR if you have the strerror() function. */
! #define HAVE_STRERROR 1
/* Define HAVE_FILENO if you have the fileno() macro. */
! #define HAVE_FILENO 1
/* Define HAVE_ERRNO if you have the errno variable */
#define HAVE_ERRNO 0
/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
! #define HAVE_SYS_ERRLIST 1
/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
#define HAVE_OSPEED 0
***************
*** 216,222 ****
#define MUST_DEFINE_OSPEED 0
/* Define HAVE_LOCALE if you have locale.h and setlocale. */
! #define HAVE_LOCALE 0
/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
#define HAVE_TERMIOS_FUNCS 0
--- 216,222 ----
#define MUST_DEFINE_OSPEED 0
/* Define HAVE_LOCALE if you have locale.h and setlocale. */
! #define HAVE_LOCALE 1
/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
#define HAVE_TERMIOS_FUNCS 0
***************
*** 243,249 ****
#define HAVE_CTYPE_H 1
/* Define if you have the <errno.h> header file. */
! #define HAVE_ERRNO_H 0
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
--- 243,249 ----
#define HAVE_CTYPE_H 1
/* Define if you have the <errno.h> header file. */
! #define HAVE_ERRNO_H 1
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
***************
*** 261,279 ****
#define HAVE_SYS_STREAM_H 0
/* Define if you have the <termcap.h> header file. */
! /* #undef HAVE_TERMCAP_H */
/* Define if you have the <termio.h> header file. */
#define HAVE_TERMIO_H 0
/* Define if you have the <termios.h> header file. */
! #define HAVE_TERMIOS_H 1
/* Define if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
! #define HAVE_UNISTD_H 1
/* Define if you have the <values.h> header file. */
#define HAVE_VALUES_H 0
--- 261,298 ----
#define HAVE_SYS_STREAM_H 0
/* Define if you have the <termcap.h> header file. */
! #define HAVE_TERMCAP_H 0
/* Define if you have the <termio.h> header file. */
#define HAVE_TERMIO_H 0
/* Define if you have the <termios.h> header file. */
! #define HAVE_TERMIOS_H 0
/* Define if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
! #define HAVE_UNISTD_H 0
/* Define if you have the <values.h> header file. */
#define HAVE_VALUES_H 0
+
+ #if _MSC_VER >= 700
+ /*
+ * The names of these things changed in Microsoft C version 7.0.
+ */
+ #define videoconfig _videoconfig
+ #define rccoord _rccoord
+ #define off_t _off_t
+ #define O_RDONLY _O_RDONLY
+ #define O_WRONLY _O_WRONLY
+ #define O_APPEND _O_APPEND
+ #define O_BINARY _O_BINARY
+ #define O_TEXT _O_TEXT
+ #define find_t _find_t
+ #define stat _stat
+ #define S_IFMT _S_IFMT
+ #define S_IFDIR _S_IFDIR
+ #define S_IFREG _S_IFREG
+ #endif
diff -cbr orig/defines.h new/defines.h
*** orig/defines.h Fri Feb 24 22:25:50 1995
--- new/defines.h Thu Nov 09 10:36:40 1995
***************
*** 75,81 ****
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
! #define EDIT_PGM "me"
/*
* TAGS is 1 if you wish to support tag files.
--- 75,81 ----
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
! #define EDIT_PGM "emacs"
/*
* TAGS is 1 if you wish to support tag files.
diff -cbr orig/doscreen.c new/doscreen.c
*** orig/doscreen.c Wed Feb 01 01:55:36 1995
--- new/doscreen.c Thu Nov 09 10:36:42 1995
***************
*** 49,54 ****
--- 49,55 ----
public int ul_s_width, ul_e_width; /* Printing width of underline seq */
public int so_s_width, so_e_width; /* Printing width of standout seq */
public int bl_s_width, bl_e_width; /* Printing width of blink seq */
+ public int can_goto_line; /* Can move cursor to any line */
public int nm_fg_color = 7; /* Color of normal text */
public int nm_bg_color = 0;
***************
*** 69,75 ****
extern int know_dumb; /* Don't complain about a dumb terminal */
extern int back_scroll;
extern int swindow;
- extern char *getenv();
/*
* Change terminal to "raw mode", or restore to "normal" mode.
--- 70,75 ----
***************
*** 110,123 ****
if (w.numtextrows)
*p_height = w.numtextrows;
! else if ((s = getenv("LINES")) != NULL && *s != '\0')
*p_height = atoi(s);
if (*p_height <= 0)
*p_height = 24;
if (w.numtextcols > 0)
*p_width = w.numtextcols;
! else if ((s = getenv("COLUMNS")) != NULL)
*p_width = atoi(s);
if (*p_width <= 0)
*p_width = 80;
--- 110,123 ----
if (w.numtextrows)
*p_height = w.numtextrows;
! else if ((s = lgetenv("LINES")) != NULL && *s != '\0')
*p_height = atoi(s);
if (*p_height <= 0)
*p_height = 24;
if (w.numtextcols > 0)
*p_width = w.numtextcols;
! else if ((s = lgetenv("COLUMNS")) != NULL)
*p_width = atoi(s);
if (*p_width <= 0)
*p_width = 80;
***************
*** 181,186 ****
--- 181,211 ----
/*
+ * Initialize the screen to the correct color at startup.
+ */
+ static void
+ initcolor()
+ {
+ struct videoconfig w;
+ char *blanks;
+ int row;
+ int col;
+
+ /*
+ * Create a complete, blank screen using "normal" colors.
+ */
+ _settextcolor(nm_fg_color);
+ _setbkcolor(nm_bg_color);
+ _getvideoconfig(&w);
+ blanks = (char *) ecalloc(w.numtextcols, sizeof(char));
+ for (col = 0; col < w.numtextcols; col++)
+ blanks[col] = ' ';
+ for (row = w.numtextrows; row > 0; row--)
+ _outmem(blanks, w.numtextcols);
+ free(blanks);
+ }
+
+ /*
* Initialize terminal
*/
public void
***************
*** 189,194 ****
--- 214,220 ----
/* {{ What could we take no_init (-X) to mean? }} */
sy_bg_color = _getbkcolor();
sy_fg_color = _gettextcolor();
+ initcolor();
flush();
init_done = 1;
}
***************
*** 273,278 ****
--- 299,315 ----
{
flush();
_settextposition(sc_height,1);
+ }
+
+ /*
+ * Goto a specific line on the screen.
+ */
+ public void
+ goto_line(slinenum)
+ int slinenum;
+ {
+ flush();
+ _settextposition(slinenum, 1);
}
/*
diff -cbr orig/edit.c new/edit.c
*** orig/edit.c Thu Nov 09 10:35:26 1995
--- new/edit.c Mon Apr 10 10:05:54 1995
***************
*** 276,281 ****
--- 276,291 ----
*/
(void) edit_ifile(was_curr_ifile);
return (1);
+ } else if ((answer = isZfile(filename)) >= 0)
+ {
+ if ((f = Zopen(filename, answer)) < 0)
+ {
+ parg.p_string = errno_message(filename);
+ error("%s", &parg);
+ free(parg.p_string);
+ return (1);
+ }
+ chflags |= CH_COMPRESSED;
} else if ((f = open(open_filename, OPEN_READ)) < 0)
{
/*
diff -cbr orig/filename.c new/filename.c
*** orig/filename.c Thu Nov 09 11:12:22 1995
--- new/filename.c Thu Nov 09 10:36:42 1995
***************
*** 92,105 ****
/*
* Try $HOME/filename.
*/
! pathname = dirfile(getenv("HOME"), filename);
if (pathname != NULL)
return (pathname);
#if OS2
/*
* Try $INIT/filename.
*/
! pathname = dirfile(getenv("INIT"), filename);
if (pathname != NULL)
return (pathname);
#endif
--- 92,105 ----
/*
* Try $HOME/filename.
*/
! pathname = dirfile(lgetenv("HOME"), filename);
if (pathname != NULL)
return (pathname);
#if OS2
/*
* Try $INIT/filename.
*/
! pathname = dirfile(lgetenv("INIT"), filename);
if (pathname != NULL)
return (pathname);
#endif
***************
*** 124,130 ****
{
register char *helpfile;
! if ((helpfile = getenv("LESSHELP")) != NULL)
return (save(helpfile));
#if MSOFTC || OS2
return (homefile(HELPFILE));
--- 124,130 ----
{
register char *helpfile;
! if ((helpfile = lgetenv("LESSHELP")) != NULL)
return (save(helpfile));
#if MSOFTC || OS2
return (homefile(HELPFILE));
***************
*** 134,141 ****
}
/*
! * Expand a string, substituting any "%" with the current filename,
! * and any "#" with the previous filename.
* {{ This is a lot of work just to support % and #. }}
*/
public char *
--- 134,143 ----
}
/*
! * Expand a string, substituting any single "%" with the current filename,
! * and any single "#" with the previous filename.
! * "#" and "%" are self quoting. Any sequence of 2 or more of them
! * inserts the sequence - 1 of "%" or "#" chars into the command line.
* {{ This is a lot of work just to support % and #. }}
*/
public char *
***************
*** 145,178 ****
register char *fr, *to;
register int n;
register char *e;
/*
* Make one pass to see how big a buffer we
* need to allocate for the expanded string.
*/
n = 0;
for (fr = s; *fr != '\0'; fr++)
{
switch (*fr)
{
case '%':
! if (curr_ifile == NULL_IFILE)
{
! /* error("No current file", NULL_PARG); */
! return (save(s));
}
n += strlen(get_filename(curr_ifile));
break;
case '#':
! if (old_ifile == NULL_IFILE)
{
! /* error("No previous file", NULL_PARG); */
! return (save(s));
}
n += strlen(get_filename(old_ifile));
break;
default:
n++;
break;
}
}
--- 147,210 ----
register char *fr, *to;
register int n;
register char *e;
+ int percent_quote = FALSE; /* Set initial state of machine to */
+ int hash_quote = FALSE; /* no sequence in progress. */
/*
* Make one pass to see how big a buffer we
* need to allocate for the expanded string.
*/
+ /*
+ * The self quoting system is a state machine. We look ahead
+ * one character to put ourselves into one or the other self
+ * quote states, and when we get a different character, we
+ * turn the previous quote state off. We count and later
+ * insert, 1 less than the actual sequence of special
+ * characters into the output buffer, if there is a sequence.
+ * If there is a file error condition, we no longer bug out,
+ * we just do not count the unexpanded character or place it
+ * in the output buffer and we continue to check the rest of
+ * the string for single "%" or "#"s to expand or sequences to
+ * insert.
+ */
n = 0;
for (fr = s; *fr != '\0'; fr++)
{
switch (*fr)
{
case '%':
! if (hash_quote)
! hash_quote = FALSE;
! if (*(fr+1) == '%' || percent_quote)
{
! if (!percent_quote)
! percent_quote = TRUE;
! else
! n++;
}
+ else if (curr_ifile != NULL_IFILE)
n += strlen(get_filename(curr_ifile));
break;
case '#':
! if (percent_quote)
! percent_quote = FALSE;
! if (*(fr+1) == '#' || hash_quote)
{
! if (!hash_quote)
! hash_quote = TRUE;
! else
! n++;
}
+ else if (old_ifile != NULL_IFILE)
n += strlen(get_filename(old_ifile));
break;
default:
n++;
+ if (percent_quote || hash_quote)
+ {
+ percent_quote = FALSE;
+ hash_quote = FALSE;
+ }
break;
}
}
***************
*** 183,202 ****
--- 215,269 ----
* Now copy the string, expanding any "%" or "#".
*/
to = e;
+ /*
+ * Reset the state machine in case we ended on a sequence
+ * of "%" or "#" characters.
+ */
+ percent_quote = FALSE;
+ hash_quote = FALSE;
for (fr = s; *fr != '\0'; fr++)
{
switch (*fr)
{
case '%':
+ if (hash_quote)
+ hash_quote = FALSE;
+ if (*(fr+1) == '%' || percent_quote)
+ {
+ if (!percent_quote)
+ percent_quote = TRUE;
+ else
+ *to++ = *fr;
+ }
+ else if (curr_ifile != NULL_IFILE)
+ {
strcpy(to, get_filename(curr_ifile));
to += strlen(to);
+ }
break;
case '#':
+ if (percent_quote)
+ percent_quote = FALSE;
+ if (*(fr+1) == '#' || hash_quote)
+ {
+ if (!hash_quote)
+ hash_quote = TRUE;
+ else
+ *to++ = *fr;
+ }
+ else if (old_ifile != NULL_IFILE)
+ {
strcpy(to, get_filename(old_ifile));
to += strlen(to);
+ }
break;
default:
*to++ = *fr;
+ if (percent_quote || hash_quote)
+ {
+ percent_quote = FALSE;
+ hash_quote = FALSE;
+ }
break;
}
}
***************
*** 360,366 ****
scmd = (char *) ecalloc(len, sizeof(char));
sprintf(scmd, cmd, s1, s2);
#if HAVE_SHELL
! shell = getenv("SHELL");
if (shell != NULL && *shell != '\0')
{
/*
--- 427,433 ----
scmd = (char *) ecalloc(len, sizeof(char));
sprintf(scmd, cmd, s1, s2);
#if HAVE_SHELL
! shell = lgetenv("SHELL");
if (shell != NULL && *shell != '\0')
{
/*
***************
*** 395,407 ****
int length;
list = _fnexplode(filename);
! length = 1;
for (cnt = 0; list[cnt] != NULL; cnt++)
length += strlen(list[cnt]) + 1;
gfilename = (char *) ecalloc(length, sizeof(char));
for (cnt = 0; list[cnt] != NULL; cnt++)
{
strcat(gfilename, list[cnt]);
strcat(gfilename, " ");
}
_fnexplodefree(list);
--- 462,477 ----
int length;
list = _fnexplode(filename);
! if (list == NULL)
! return (filename);
! length = 0;
for (cnt = 0; list[cnt] != NULL; cnt++)
length += strlen(list[cnt]) + 1;
gfilename = (char *) ecalloc(length, sizeof(char));
for (cnt = 0; list[cnt] != NULL; cnt++)
{
strcat(gfilename, list[cnt]);
+ if (list[cnt+1] != NULL)
strcat(gfilename, " ");
}
_fnexplodefree(list);
***************
*** 452,458 ****
FILE *fd;
ch_ungetchar(-1);
! if ((lessopen = getenv("LESSOPEN")) == NULL)
return (NULL);
if (strcmp(filename, "-") == 0)
return (NULL);
--- 522,528 ----
FILE *fd;
ch_ungetchar(-1);
! if ((lessopen = lgetenv("LESSOPEN")) == NULL)
return (NULL);
if (strcmp(filename, "-") == 0)
return (NULL);
***************
*** 525,531 ****
if (pipefd != NULL)
pclose((FILE*) pipefd);
! if ((lessclose = getenv("LESSCLOSE")) == NULL)
return;
fd = shellcmd(lessclose, filename, altfilename);
pclose(fd);
--- 595,601 ----
if (pipefd != NULL)
pclose((FILE*) pipefd);
! if ((lessclose = lgetenv("LESSCLOSE")) == NULL)
return;
fd = shellcmd(lessclose, filename, altfilename);
pclose(fd);
diff -cbr orig/forwback.c new/forwback.c
*** orig/forwback.c Thu Nov 09 10:35:26 1995
--- new/forwback.c Mon Apr 17 20:00:02 1995
***************
*** 36,41 ****
--- 36,42 ----
public int hit_eof; /* Keeps track of how many times we hit end of file */
public int screen_trashed;
public int squished;
+ public int no_back_scroll = 0;
extern int sigs;
extern int top_scroll;
***************
*** 390,395 ****
--- 391,398 ----
public int
get_back_scroll()
{
+ if (no_back_scroll)
+ return (0);
if (back_scroll >= 0)
return (back_scroll);
if (top_scroll)
diff -cbr orig/funcs.h new/funcs.h
*** orig/funcs.h Thu Mar 09 22:34:20 1995
--- new/funcs.h Thu Nov 09 10:36:42 1995
***************
*** 68,76 ****
--- 68,78 ----
public void init_cmds ();
public void add_fcmd_table ();
public void add_ecmd_table ();
+ public void add_var_table ();
public int cmd_search ();
public int fcmd_decode ();
public int ecmd_decode ();
+ public char * lgetenv ();
public int lesskey ();
public void add_hometable ();
public int editchar ();
diff -cbr orig/less.h new/less.h
*** orig/less.h Thu Nov 09 10:35:26 1995
--- new/less.h Mon Apr 10 10:05:54 1995
***************
*** 244,252 ****
#define QUIT_SAVED_STATUS (-1)
/* filestate flags */
! #define CH_CANSEEK 001
! #define CH_KEEPOPEN 002
! #define CH_POPENED 004
#define ch_zero() ((POSITION)0)
--- 244,253 ----
#define QUIT_SAVED_STATUS (-1)
/* filestate flags */
! #define CH_CANSEEK 0x01
! #define CH_KEEPOPEN 0x02
! #define CH_POPENED 0x04
! #define CH_COMPRESSED 0x08
#define ch_zero() ((POSITION)0)
diff -cbr orig/less.nro new/less.nro
*** orig/less.nro Thu Mar 02 23:15:00 1995
--- new/less.nro Thu Nov 09 10:36:42 1995
***************
*** 113,122 ****
.IP "p or %"
Go to a position N percent into the file.
N should be between 0 and 100.
- (This works if standard input is being read, but only if
- .I less
- has already read to the end of the file.
- It is always fast, but not always useful.)
.PP
.IP "{"
If a left curly bracket appears in the top line displayed
--- 113,118 ----
***************
*** 1164,1169 ****
--- 1160,1169 ----
changed to modify this default.
.SH "ENVIRONMENT VARIABLES"
+ Environment variables may be specified either in the system environment
+ as usual, or in a
+ .I lesskey
+ (1) file.
.IP COLUMNS
Sets the number of columns on the screen.
Takes precedence over the number of columns specified by the TERM variable.
diff -cbr orig/lesskey.c new/lesskey.c
*** orig/lesskey.c Thu Nov 09 10:35:28 1995
--- new/lesskey.c Thu Nov 09 10:36:44 1995
***************
*** 63,70 ****
--- 63,74 ----
*
* Blank lines and lines which start with # are ignored,
* except for the special control lines:
+ * #command Signals the beginning of the command
+ * keys section.
* #line-edit Signals the beginning of the line-editing
* keys section.
+ * #env Signals the beginning of the environment
+ * variable section.
* #stop Stops command parsing in less;
* causes all default keys to be disabled.
*
***************
*** 96,101 ****
--- 100,106 ----
#include "less.h"
#include "lesskey.h"
#include "cmd.h"
+ #include <ctype.h>
struct cmdname
{
***************
*** 190,195 ****
--- 195,201 ----
struct table cmdtable;
struct table edittable;
+ struct table vartable;
struct table *currtable = &cmdtable;
char fileheader[] = {
***************
*** 205,210 ****
--- 211,217 ----
};
char cmdsection[1] = { CMD_SECTION };
char editsection[1] = { EDIT_SECTION };
+ char varsection[1] = { VAR_SECTION };
char endsection[1] = { END_SECTION };
char *infile = NULL;
***************
*** 308,313 ****
--- 315,323 ----
edittable.names = editnames;
edittable.pbuffer = edittable.buffer;
+
+ vartable.names = NULL;
+ vartable.pbuffer = vartable.buffer;
}
/*
***************
*** 450,455 ****
--- 460,470 ----
currtable = &cmdtable;
return (1);
}
+ if (PREFIX(s, "#env"))
+ {
+ currtable = &vartable;
+ return (1);
+ }
if (PREFIX(s, "#stop"))
{
add_cmd_char('\0');
***************
*** 528,561 ****
}
- /*
- * Parse a line from the lesskey file.
- */
void
! parse_line(line)
! char *line;
! {
char *p;
int cmdlen;
char *actname;
int action;
int c;
/*
- * See if it is a control line.
- */
- if (control_line(line))
- return;
- /*
- * Skip leading white space.
- * Replace the final newline with a null byte.
- * Ignore blank lines and comments.
- */
- p = clean_line(line);
- if (*p == '\0')
- return;
-
- /*
* Parse the command string and store it in the current table.
*/
cmdlen = 0;
--- 543,558 ----
}
void
! parse_cmdline(p)
char *p;
+ {
int cmdlen;
char *actname;
int action;
int c;
/*
* Parse the command string and store it in the current table.
*/
cmdlen = 0;
***************
*** 614,619 ****
--- 611,679 ----
}
}
+ void
+ parse_varline(p)
+ char *p;
+ {
+ int c;
+
+ do
+ {
+ c = tchar(&p);
+ add_cmd_char(toupper(c));
+ } while (*p != ' ' && *p != '\t' && *p != '=' && *p != '\0');
+ /*
+ * Terminate the variable name with a null byte.
+ */
+ add_cmd_char('\0');
+
+ p = skipsp(p);
+ if (*p++ != '=')
+ {
+ error("missing =");
+ return;
+ }
+
+ add_cmd_char(EV_OK|A_EXTRA);
+
+ p = skipsp(p);
+ while (*p != '\0')
+ {
+ c = tchar(&p);
+ add_cmd_char(c);
+ }
+ add_cmd_char('\0');
+ }
+
+ /*
+ * Parse a line from the lesskey file.
+ */
+ void
+ parse_line(line)
+ char *line;
+ {
+ char *p;
+
+ /*
+ * See if it is a control line.
+ */
+ if (control_line(line))
+ return;
+ /*
+ * Skip leading white space.
+ * Replace the final newline with a null byte.
+ * Ignore blank lines and comments.
+ */
+ p = clean_line(line);
+ if (*p == '\0')
+ return;
+
+ if (currtable == &vartable)
+ parse_varline(p);
+ else
+ parse_cmdline(p);
+ }
+
main(argc, argv)
int argc;
char *argv[];
***************
*** 622,627 ****
--- 682,692 ----
FILE *out;
char line[200];
+ #ifdef OS2
+ if (argc == 1)
+ usage();
+ #endif
+
/*
* Process command line arguments.
*/
***************
*** 679,684 ****
--- 744,754 ----
fputbytes(out, editsection, sizeof(editsection));
fputint(out, edittable.pbuffer - edittable.buffer);
fputbytes(out, (char *)edittable.buffer, edittable.pbuffer-edittable.buffer);
+
+ /* Environment variable section */
+ fputbytes(out, varsection, sizeof(varsection));
+ fputint(out, vartable.pbuffer - vartable.buffer);
+ fputbytes(out, (char *)vartable.buffer, vartable.pbuffer-vartable.buffer);
/* File trailer */
fputbytes(out, endsection, sizeof(endsection));
diff -cbr orig/lesskey.h new/lesskey.h
*** orig/lesskey.h Wed Feb 01 01:55:52 1995
--- new/lesskey.h Thu Nov 09 10:36:44 1995
***************
*** 18,23 ****
--- 18,24 ----
#define CMD_SECTION 'c'
#define EDIT_SECTION 'e'
+ #define VAR_SECTION 'v'
#define END_SECTION 'x'
#define C0_END_LESSKEY_MAGIC 'E'
diff -cbr orig/lesskey.nro new/lesskey.nro
*** orig/lesskey.nro Wed Feb 01 01:55:56 1995
--- new/lesskey.nro Thu Nov 09 10:36:46 1995
***************
*** 19,25 ****
.I lesskey
will overwrite it.
.PP
! The input file consists of lines of the form:
.sp
\fIstring\fP <whitespace> \fIaction\fP [extra-string] <newline>
.sp
--- 19,51 ----
.I lesskey
will overwrite it.
.PP
! The -V flag causes
! .I lesskey
! to print its version number and immediately exit.
! If -V is present, other flags and arguments are ignored.
! .PP
! The input file consists of one or more
! .I sections.
! Each section starts with a line that identifies the type of section.
! Possible sections are:
! .IP #command
! Defines new command keys.
! .IP #line-edit
! Defines new line-editing keys.
! .IP #env
! Defines environment variables.
! .PP
! Blank lines and lines which start with a pound sign (#) are ignored,
! except for the special section header lines.
!
! .SH "COMMAND SECTION"
! The command section begins with the line
! .sp
! #command
! .sp
! If the command section is the first section in the file,
! this line may be omitted.
! The command section consists of lines of the form:
.sp
\fIstring\fP <whitespace> \fIaction\fP [extra-string] <newline>
.sp
***************
*** 37,43 ****
to be taken literally.
Characters which must be preceded by backslash include
caret, space, tab and the backslash itself.
- Blank lines and lines which start with a pound sign (#) are ignored.
.PP
An action may be followed by an "extra" string.
When such a command is entered while running
--- 63,68 ----
***************
*** 48,64 ****
This feature can be used in certain cases to extend
the functionality of a command.
For example, see the "{" and ":t" commands in the example below.
- .PP
- The -V flag causes
- .I lesskey
- to print its version number and immediately exit.
- Other flags and arguments are ignored.
.SH EXAMPLE
The following input file describes the set of
default command keys used by less:
.sp
.nf
\er forw-line
\en forw-line
e forw-line
--- 73,85 ----
This feature can be used in certain cases to extend
the functionality of a command.
For example, see the "{" and ":t" commands in the example below.
.SH EXAMPLE
The following input file describes the set of
default command keys used by less:
.sp
.nf
+ #command
\er forw-line
\en forw-line
e forw-line
***************
*** 164,170 ****
.sp
This will cause all default commands to be ignored.
The #stop line should be the last line in that section of the file.
- (Another section, introduced by #line-edit, may follow the #stop line.)
.PP
Be aware that #stop can be dangerous.
Since all default commands are disabled,
--- 185,190 ----
***************
*** 172,186 ****
to enable all necessary actions.
For example, failure to provide a "quit" command can lead to frustration.
! .SH "LINE EDITING"
! New key bindings may be specified for the line editing commands,
! in a manner similar to the way key bindings for
! ordinary commands are specified.
! This control line marks the beginning of a section of line-editing commands:
.sp
#line-edit
.sp
! Following this line is a list of keys and actions,
one per line as in the example below.
.SH EXAMPLE
--- 192,206 ----
to enable all necessary actions.
For example, failure to provide a "quit" command can lead to frustration.
! .SH "LINE EDITING SECTION"
! The line-editing section begins with the line:
.sp
#line-edit
.sp
! This section specifies new key bindings for the line editing commands,
! in a manner similar to the way key bindings for
! ordinary commands are specified in the #command section.
! The line-editing section consists of a list of keys and actions,
one per line as in the example below.
.SH EXAMPLE
***************
*** 209,216 ****
--- 229,273 ----
.fi
.sp
+ .SH "LESS ENVIRONMENT VARIABLES"
+ The environment variable section begins with the line
+ .sp
+ #env
+ .sp
+ Following this line is a list of environment variable assignments.
+ Each line consists of an environment variable name, an equals sign (=)
+ and the value to be assigned to the environment variable.
+ White space before and after the equals sign is ignored.
+ Variables assigned in this way are visible only to
+ .I less.
+ If a variable is specified in the system environment and also in a
+ lesskey file, the value in the lesskey file takes precedence.
+ Although the lesskey file can be used to override variables set in the
+ environment, the main purpose of assigning variables in the lesskey file
+ is simply to have all
+ .I less
+ configuration information stored in one file.
+
+ .SH EXAMPLE
+ The following input file sets the -i flag whenever
+ .I less
+ is run, and specifies the character set to be "latin1":
+ .sp
+ .nf
+ #env
+ LESS = -i
+ LESSCHARSET = latin1
+ .fi
+ .sp
+
.SH "SEE ALSO"
less(1)
+
+ .SH WARNINGS
+ It is not possible to specify special keys, such as uparrow,
+ in a keyboard-independent manner.
+ The only way to specify such keys is to specify the escape sequence
+ which a particular keyboard sends when such a keys is pressed.
.SH COPYRIGHT
Copyright (c) 1984,1985,1989,1994,1995 Mark Nudelman
diff -cbr orig/lsystem.c new/lsystem.c
*** orig/lsystem.c Wed Feb 01 01:55:58 1995
--- new/lsystem.c Thu Nov 09 10:36:46 1995
***************
*** 110,116 ****
*/
#if HAVE_SHELL
p = NULL;
! if ((shell = getenv("SHELL")) != NULL && *shell != '\0')
{
if (*cmd == '\0')
p = save(shell);
--- 110,116 ----
*/
#if HAVE_SHELL
p = NULL;
! if ((shell = lgetenv("SHELL")) != NULL && *shell != '\0')
{
if (*cmd == '\0')
p = save(shell);
diff -cbr orig/main.c new/main.c
*** orig/main.c Thu Nov 09 10:35:28 1995
--- new/main.c Thu Nov 09 10:27:08 1995
***************
*** 78,86 ****
--- 78,98 ----
{
IFILE ifile;
+ #if OS2
#ifdef __EMX__
_response(&argc, &argv);
_wildcard(&argc, &argv);
+ #endif
+ if (isatty(0) && argc == 1)
+ {
+ extern char version[];
+ printf("\nless version %s.\n", version);
+ printf("\nUsage: less [-[+]aABcCdeEfgimMnNqQruUsw] [-bN] [-hN] [-xN] [-[z]N]"
+ "\n [-P[mM=]string] [-[lL]logfile] [-kkeyfile]"
+ "\n [+cmd] [-ttag] [filename]...\n"
+ "\n or: less -?\n", progname);
+ exit(1);
+ }
#endif
progname = *argv++;
diff -cbr orig/Makefile.dos new/makefile.dos
*** orig/Makefile.dos Wed Feb 01 01:55:16 1995
--- new/makefile.dos Thu Nov 09 10:36:46 1995
***************
*** 6,21 ****
CC = cl
LIBDIR = \msc6.0\lib
! CFLAGS = -O /Alfw
LDFLAGS = -O
! LIBS = ${LIBDIR}\llibce.lib ${LIBDIR}\graphics.lib
#### End of system configuration section. ####
# This rule allows us to supply the necessary -D options
# in addition to whatever the user asks for.
.c.obj:
! ${CC} -c -I. ${CPPFLAGS} ${CFLAGS} $<
SRC = main.c doscreen.c brac.c ch.c charset.c cmdbuf.c command.c \
decode.c edit.c filename.c forwback.c help.c ifile.c \
--- 6,21 ----
CC = cl
LIBDIR = \msc6.0\lib
! CFLAGS = -O -Alfw
LDFLAGS = -O
! LIBS = $(LIBDIR)\llibce.lib $(LIBDIR)\graphics.lib
#### End of system configuration section. ####
# This rule allows us to supply the necessary -D options
# in addition to whatever the user asks for.
.c.obj:
! $(CC) -c -I. $(CPPFLAGS) $(CFLAGS) $<
SRC = main.c doscreen.c brac.c ch.c charset.c cmdbuf.c command.c \
decode.c edit.c filename.c forwback.c help.c ifile.c \
***************
*** 30,48 ****
position.obj prompt.obj search.obj signal.obj tags.obj \
ttyin.obj version.obj
! all: less lesskey
# This is really horrible, but the command line is too long for
# MS-DOS if we try to link $(OBJ).
! less: $(OBJ)
! -del lesskey.obj
$(CC) $(LDFLAGS) -o $@ *.obj $(LIBS)
! lesskey: lesskey.obj version.obj
$(CC) $(LDFLAGS) -o $@ lesskey.obj version.obj $(LIBS)
defines.h: defines.dos
- -del defines.h
-copy defines.dos defines.h
$(OBJ): less.h defines.h
--- 30,48 ----
position.obj prompt.obj search.obj signal.obj tags.obj \
ttyin.obj version.obj
! all: less.exe lesskey.exe
# This is really horrible, but the command line is too long for
# MS-DOS if we try to link $(OBJ).
! less.exe: $(OBJ)
! -ren lesskey.obj lesskey.obo
$(CC) $(LDFLAGS) -o $@ *.obj $(LIBS)
+ -ren lesskey.obo lesskey.obj
! lesskey.exe: lesskey.obj version.obj
$(CC) $(LDFLAGS) -o $@ lesskey.obj version.obj $(LIBS)
defines.h: defines.dos
-copy defines.dos defines.h
$(OBJ): less.h defines.h
diff -cbr orig/Makefile.in new/makefile.in
*** orig/Makefile.in Mon Mar 13 23:41:54 1995
--- new/makefile.in Thu Nov 09 10:36:46 1995
***************
*** 116,123 ****
lint:
lint -I. ${CPPFLAGS} ${SRC}
newfuncs:
! mv -f funcs.h funcs.h.old
! awk -f mkfuncs.awk ${SRC} >funcs.h
clean:
rm -f *.${O} core less lesskey
--- 116,123 ----
lint:
lint -I. ${CPPFLAGS} ${SRC}
newfuncs:
! mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
! awk -f ${srcdir}/mkfuncs.awk ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
clean:
rm -f *.${O} core less lesskey
diff -cbr orig/Makefile.os2 new/makefile.os2
*** orig/Makefile.os2 Thu Nov 09 10:35:28 1995
--- new/makefile.os2 Thu Nov 09 10:36:46 1995
***************
*** 11,20 ****
#### End of system configuration section. ####
- .SUFFIXES: .c .$(O)
-
# This rule allows us to supply the necessary -D options
# in addition to whatever the user asks for.
.c.$(O):
${CC} -c ${CPPFLAGS} ${CFLAGS} $<
--- 11,20 ----
#### End of system configuration section. ####
# This rule allows us to supply the necessary -D options
# in addition to whatever the user asks for.
+
+ .SUFFIXES: .c .$(O)
.c.$(O):
${CC} -c ${CPPFLAGS} ${CFLAGS} $<
***************
*** 23,29 ****
help.$(O) ifile.$(O) input.$(O) jump.$(O) line.$(O) linenum.$(O) \
lsystem.$(O) mark.$(O) optfunc.$(O) option.$(O) opttbl.$(O) os.$(O) \
output.$(O) position.$(O) prompt.$(O) search.$(O) signal.$(O) \
! tags.$(O) ttyin.$(O) version.$(O) regexp.$(O)
all: less.exe lesskey.exe
--- 23,29 ----
help.$(O) ifile.$(O) input.$(O) jump.$(O) line.$(O) linenum.$(O) \
lsystem.$(O) mark.$(O) optfunc.$(O) option.$(O) opttbl.$(O) os.$(O) \
output.$(O) position.$(O) prompt.$(O) search.$(O) signal.$(O) \
! tags.$(O) ttyin.$(O) version.$(O) regexp.$(O) zfiles.$(O)
all: less.exe lesskey.exe
***************
*** 31,37 ****
$(CC) $(OBJ) -o $@ $(LDFLAGS) $(LIBS)
lesskey.exe: lesskey.$(O) version.$(O)
! $(CC) $(CFLAGS) lesskey.$(O) version.$(O) -o $@ $(LDFLAGS)
$(OBJ): defines.h less.h
--- 31,37 ----
$(CC) $(OBJ) -o $@ $(LDFLAGS) $(LIBS)
lesskey.exe: lesskey.$(O) version.$(O)
! $(CC) lesskey.$(O) version.$(O) -o $@ $(LDFLAGS)
$(OBJ): defines.h less.h
diff -cbr orig/NEWS new/news
*** orig/NEWS Sat Mar 11 03:46:58 1995
--- new/news Thu Nov 09 10:36:48 1995
***************
*** 1,3 ****
--- 1,12 ----
+ Major changes between "less" versions 290 and 291
+
+ * Less environment variables can be specified in lesskey files.
+
+ * Fixed MS-DOS build.
+
+ ======================================================================
+
+
Major changes between "less" versions 278 and 290
* Accepts GNU-style options "--help" and "--version".
diff -cbr orig/os.c new/os.c
*** orig/os.c Wed Feb 01 01:56:06 1995
--- new/os.c Thu Nov 09 10:36:48 1995
***************
*** 177,183 ****
--- 177,187 ----
register char *p;
register char *m;
#if HAVE_ERRNO
+ #if MSOFTC
+ /* errno is declared in errno.h */
+ #else
extern int errno;
+ #endif
p = strerror(errno);
#else
p = "cannot open";
diff -cbr orig/README new/readme
*** orig/README Tue Apr 18 09:34:36 1995
--- new/readme Thu Nov 09 10:37:20 1995
***************
*** 1,5 ****
=======================================================================
! === NOTE: THIS IS A DISTRIBUTION OF less (version 290) ===
=== PLEASE REPORT ANY PROBLEMS TO THE AUTHOR AT markn@3do.com. ===
=======================================================================
--- 1,5 ----
=======================================================================
! === NOTE: THIS IS A DISTRIBUTION OF less (version 291) ===
=== PLEASE REPORT ANY PROBLEMS TO THE AUTHOR AT markn@3do.com. ===
=======================================================================
***************
*** 125,127 ****
--- 125,132 ----
lesskey.exe and less.hlp in a directory which is included in
your PATH.
+ 9. Make sure, you have the emx runtime installed. You need the emx DLL's
+ emx.dll and emxlibcs.dll an also the termcap database, termcap.dat.
+ Make sure you have termcap.dat either in the default location or
+ or somewhere in a directory listed in the PATH or INIT environment
+ variables.
diff -cbr orig/screen.c new/screen.c
*** orig/screen.c Thu Nov 09 10:35:44 1995
--- new/screen.c Thu Nov 09 10:46:12 1995
***************
*** 133,139 ****
extern int quiet; /* If VERY_QUIET, use visual bell for bell */
extern int know_dumb; /* Don't complain about a dumb terminal */
! extern int back_scroll;
extern int swindow;
extern int no_init;
#if HILITE_SEARCH
--- 133,139 ----
extern int quiet; /* If VERY_QUIET, use visual bell for bell */
extern int know_dumb; /* Don't complain about a dumb terminal */
! extern int no_back_scroll;
extern int swindow;
extern int no_init;
#if HILITE_SEARCH
***************
*** 461,467 ****
else
#endif
#endif
! if ((s = getenv("LINES")) != NULL)
sc_height = atoi(s);
else
sc_height = tgetnum("li");
--- 461,467 ----
else
#endif
#endif
! if ((s = lgetenv("LINES")) != NULL)
sc_height = atoi(s);
else
sc_height = tgetnum("li");
***************
*** 479,485 ****
else
#endif
#endif
! if ((s = getenv("COLUMNS")) != NULL)
sc_width = atoi(s);
else
sc_width = tgetnum("co");
--- 479,485 ----
else
#endif
#endif
! if ((s = lgetenv("COLUMNS")) != NULL)
sc_width = atoi(s);
else
sc_width = tgetnum("co");
***************
*** 575,580 ****
--- 575,581 ----
sp = tbuf;
if ((s = tgetstr("kh", &sp)) != NULL)
{
+ put_fcmd(s, A_GOLINE);
put_ecmd(s, EC_HOME);
}
***************
*** 582,587 ****
--- 583,589 ----
sp = tbuf;
if ((s = tgetstr("@7", &sp)) != NULL)
{
+ put_fcmd(s, A_GOEND);
put_ecmd(s, EC_END);
}
***************
*** 613,620 ****
/*
* Register the two tables.
*/
! add_fcmd_table(kfcmdtable, sz_kfcmdtable);
! add_ecmd_table(kecmdtable, sz_kecmdtable);
}
#if DEBUG
--- 615,622 ----
/*
* Register the two tables.
*/
! insert_fcmd_table(kfcmdtable, sz_kfcmdtable);
! insert_ecmd_table(kecmdtable, sz_kecmdtable);
}
#if DEBUG
***************
*** 664,675 ****
char termbuf[2048];
static char sbuf[1024];
#ifdef OS2
/*
* Make sure the termcap database is available.
*/
! sp = getenv("TERMCAP");
if (sp == NULL || *sp == '\0')
{
char *termcap;
--- 666,678 ----
char termbuf[2048];
static char sbuf[1024];
+ PARG parg;
#ifdef OS2
/*
* Make sure the termcap database is available.
*/
! sp = lgetenv("TERMCAP");
if (sp == NULL || *sp == '\0')
{
char *termcap;
***************
*** 685,695 ****
/*
* Find out what kind of terminal this is.
*/
! if ((term = getenv("TERM")) == NULL)
term = DEFAULT_TERM;
! if (tgetent(termbuf, term) <= 0)
strcpy(termbuf, "dumb:hc:");
hard = tgetflag("hc");
/*
--- 688,708 ----
/*
* Find out what kind of terminal this is.
*/
! if ((term = lgetenv("TERM")) == NULL)
term = DEFAULT_TERM;
! /*Borrow "hard" here to output error messages */
! if ((hard = tgetent(termbuf, term)) <= 0)
strcpy(termbuf, "dumb:hc:");
+ if (hard == 0 && !know_dumb)
+ {
+ parg.p_string = term;
+ error("WARNING: terminal \"%s\" not found in termcap database.",&parg);
+ }
+ else if (hard == -1 && !know_dumb)
+ error("WARNING: The termcap database was not found.",NULL_PARG);
+
+ /* hard now goes back to its original purpose.... */
hard = tgetflag("hc");
/*
***************
*** 910,916 ****
/*
* Force repaint on any backward movement.
*/
! back_scroll = 0;
}
}
--- 923,929 ----
/*
* Force repaint on any backward movement.
*/
! no_back_scroll = 1;
}
}
diff -cbr orig/ttyin.c new/ttyin.c
*** orig/ttyin.c Thu Nov 09 10:35:44 1995
--- new/ttyin.c Mon Apr 10 10:06:00 1995
***************
*** 83,93 ****
return (READ_INTR);
#else
#if OS2
flush();
! while (_read_kbd(0, 0, 0) != -1)
! continue;
if ((c = _read_kbd(0, 1, 0)) == -1)
! return (READ_INTR);
result = 1;
#else
result = iread(tty, &c, sizeof(char));
--- 83,104 ----
return (READ_INTR);
#else
#if OS2
+ static int scan = -1;
flush();
! if (scan != -1)
! {
! c = scan;
! scan = -1;
! }
! else
! {
! /* while ( _read_kbd(0, 0, 0) != -1)
! continue; */
if ((c = _read_kbd(0, 1, 0)) == -1)
! return READ_INTR;
! if (c == 0 && (scan = _read_kbd(0, 0, 0)) != -1)
! c = 0xE0;
! }
result = 1;
#else
result = iread(tty, &c, sizeof(char));
diff -cbr orig/version.c new/version.c
*** orig/version.c Tue Mar 14 00:07:06 1995
--- new/version.c Thu Nov 09 10:36:50 1995
***************
*** 507,513 ****
hilite_line more than once.
v290 3/9/95 Make configure automatically. Fix Sequent problem
with incompatible sigsetmask().
*/
! char version[] = "290";
--- 507,516 ----
hilite_line more than once.
v290 3/9/95 Make configure automatically. Fix Sequent problem
with incompatible sigsetmask().
+ Posted to prep.ai.mit.edu
+ -----------------------------------------------------------------
+ v291 3/21/95 Add #env to lesskey. Fix MS-DOS build.
*/
! char version[] = "291";