mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
src/cmd/ksh93/sh.1:
- Add a new section on history expansion mostly adapted from the
"History substitution" section from the tcsh(1) man page. This
has the standard BSD license which is already in the COPYRIGHT
file. Inapplicable stuff was removed, some new stuff added.
src/cmd/ksh93/edit/hexpand.c,
src/cmd/ksh93/sh/io.c:
- Set '#' as the default history comment character as on bash;
no longer disable it by default.
- Add the 'a' modifier as a synonym for 'g', as on bash.
- Remove pointless static keyword from np variable; since the
value from previous calls is never used it can just be local.
- Use NV_NOADD flag with nv_open() to avoid pointlessly creating
the node if the variable doesn't exist yet.
- Fix a bug in history expansion where the 'p' modifier had no
effect if the 'histverify' option is on.
Reproducer:
$ set -H -o histv
$ true a b c
$ !!:p
$ true a b c▁ <= instead of printed, the line is re-edited
Expected:
$ set -H -o histv
$ true a b c
$ !!:p
true a b c
$ ▁
This is fixed by making 'p' remove the HIST_EVENT bit from the
returned flag bits in hist_expand(), leaving only the HIST_PRINT
flag, then adding special handling for this case to slowread()
in io.c (print the line, then instead of executing it, continue
and read the next line).
|
||
|---|---|---|
| .. | ||
| args.c | ||
| arith.c | ||
| array.c | ||
| defs.c | ||
| deparse.c | ||
| expand.c | ||
| fault.c | ||
| fcin.c | ||
| init.c | ||
| io.c | ||
| jobs.c | ||
| lex.c | ||
| macro.c | ||
| main.c | ||
| name.c | ||
| nvdisc.c | ||
| nvtree.c | ||
| nvtype.c | ||
| parse.c | ||
| path.c | ||
| pmain.c | ||
| shcomp.c | ||
| streval.c | ||
| string.c | ||
| subshell.c | ||
| suid_exec.c | ||
| tdump.c | ||
| timers.c | ||
| trestore.c | ||
| waitevent.c | ||
| xec.c | ||