| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`/` wrote the new pattern over the old one in ed.search and only wrote a
terminator when something had been typed. Type `ban` over `apple`, delete
the three letters, press Enter: the buffer still held "banle", so the
"empty pattern repeats the previous search" case searched a mix of the two
and found nothing (the terminal just beeped).
vi_read_pattern() collects the pattern in a local array and copies it into
ed.search only when it is non-empty; an empty pattern now really does leave
the previous one alone.
Test: tests/linux/i-vi.sh searches for apple, then types `ban` + three
backspaces + Enter, and expects `echo apple` back. Without the change the
line stays empty.
Verified on Linux with make check.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`y0` with the cursor at column 0 yanks an empty range, and the old code
then inserted the kill buffer at the cursor: with nothing killed yet that
was memcpy(dst, nullptr, 0), which UBSan rejects at src/edit_builtin.c:375;
with an earlier `cw` behind it, the old kill text was pasted into the
line (vi `y` changes nothing on the line).
The `y` case now copies the range into the kill buffer with kill_set() -
the same block remove_range() used - and puts the cursor at the start of
the range, which is where vi leaves it. insert() also returns early for
an empty string, so a later caller cannot repeat the null memcpy.
Test: tests/linux/i-vi.sh yanks an empty range after a `cw`, so the kill
buffer holds text that must not appear. Before the change UBSan reports
"null pointer passed as argument 2" and the line comes out as
"oneecho yank"; after it, the line is "echo yank".
Verified on Linux with make check and the same pty session under
ASan+UBSan.
|
| |
|
|
|
|
|
| |
The script gained the change/dot-repeat steps but the expected output
still stopped at 'echo done'. The ten lines it prints now are right:
0wx.. deletes three letters, 0dw. deletes two words, and after a motion
(l) the dot repeats the last change (x), not the motion.
|
|
|
New zash/ tests for each extension, a proc/ test showing they create no
processes, and linux/i-*.sh tests that drive the interactive shell on a
pseudo-terminal (tests/tools/ptydrive.py; skipped without python3).
The runner counts exit status 77 as "skipped". Adds a benchmark for
the arithmetic commands and removes a stray file from tests/posix.
|