Browse Source

Enable history substitution of interactive commands only when variable 'histsubst' is set.

This feature is in conflict with ! (logic inversion)
in .control language logic expressions.
pre-master-46
Holger Vogt 3 years ago
parent
commit
96bebafac5
  1. 5
      src/frontend/init.c
  2. 4
      src/frontend/parser/cshpar.c

5
src/frontend/init.c

@ -20,6 +20,7 @@ cp_init(void)
cp_chars[128]
cp_maxhistlength (set to 10000 in com_history.c)
cp_curin, cp_curout, cp_curerr (defined in streams.c)
cp_no_histsubst
*/
{
cp_vset("history", CP_NUM, &cp_maxhistlength);
@ -28,6 +29,10 @@ cp_init(void)
cp_curout = stdout;
cp_curerr = stderr;
/* Enable history substitution */
if (cp_getvar("histsubst", CP_BOOL, NULL, 0))
cp_no_histsubst = FALSE;
/* io redirection in streams.c:
cp_in set to cp_curin etc. */
cp_ioreset();

4
src/frontend/parser/cshpar.c

@ -37,8 +37,8 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include <sys/wait.h>
#endif
bool cp_no_histsubst = FALSE; /* perform history substitution by default */
/* perform history substitution only when variable 'histsubst' is set */
bool cp_no_histsubst = TRUE;
/* Things go as follows:
* (1) Read the line and do some initial quoting (by setting the 8th bit),

Loading…
Cancel
Save