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.
This commit is contained in:
Holger Vogt 2023-05-07 15:48:06 +02:00
parent e5d1885e39
commit 96bebafac5
2 changed files with 7 additions and 2 deletions

View File

@ -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();

View File

@ -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),