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:
parent
e5d1885e39
commit
96bebafac5
|
|
@ -20,6 +20,7 @@ cp_init(void)
|
||||||
cp_chars[128]
|
cp_chars[128]
|
||||||
cp_maxhistlength (set to 10000 in com_history.c)
|
cp_maxhistlength (set to 10000 in com_history.c)
|
||||||
cp_curin, cp_curout, cp_curerr (defined in streams.c)
|
cp_curin, cp_curout, cp_curerr (defined in streams.c)
|
||||||
|
cp_no_histsubst
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
cp_vset("history", CP_NUM, &cp_maxhistlength);
|
cp_vset("history", CP_NUM, &cp_maxhistlength);
|
||||||
|
|
@ -28,6 +29,10 @@ cp_init(void)
|
||||||
cp_curout = stdout;
|
cp_curout = stdout;
|
||||||
cp_curerr = stderr;
|
cp_curerr = stderr;
|
||||||
|
|
||||||
|
/* Enable history substitution */
|
||||||
|
if (cp_getvar("histsubst", CP_BOOL, NULL, 0))
|
||||||
|
cp_no_histsubst = FALSE;
|
||||||
|
|
||||||
/* io redirection in streams.c:
|
/* io redirection in streams.c:
|
||||||
cp_in set to cp_curin etc. */
|
cp_in set to cp_curin etc. */
|
||||||
cp_ioreset();
|
cp_ioreset();
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* perform history substitution only when variable 'histsubst' is set */
|
||||||
bool cp_no_histsubst = FALSE; /* perform history substitution by default */
|
bool cp_no_histsubst = TRUE;
|
||||||
|
|
||||||
/* Things go as follows:
|
/* Things go as follows:
|
||||||
* (1) Read the line and do some initial quoting (by setting the 8th bit),
|
* (1) Read the line and do some initial quoting (by setting the 8th bit),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue