[PATCH] vi: avoid touching a new file with ZZ when no editing has been done

Yousong Zhou yszhou4tech at gmail.com
Mon Feb 20 11:12:32 UTC 2017


On 20 February 2017 at 19:02, Kang-Che Sung <explorer09 at gmail.com> wrote:
> On Mon, Feb 20, 2017 at 4:40 PM, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>> On 13 February 2017 at 11:00, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>> This is the behaviour observed with standard vim and busybox vi of at
>>> least 1.22.1.  It was changed with commit "32afd3a vi: some
>>> simplifications" which happened before 1.23.0.
>>>
>>> Mistyping filename on command line happens fairly often and it's better
>>> we restore the old behaviour to avoid a few unnecessary flash writes and
>>> sometimes efforts of debugging bugs caused by those unneeded stray
>>> files...
>>>
>>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>>> ---
>>>  editors/vi.c | 16 ++++++++--------
>>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>>
>>
>> Hello, list, any thoughts on this one?
>
> Would you please show us a "steps to reproduce" in order for us to
> demonstrate which problem you are trying to address, and what're the
> behavior differences.

Here is a step-by-step example

 1. shell command: vi file-not-yet-there
 2. vi command: ZZ
 3. shell command: ls -l file-not-yet-there

With vim and vi of busybox 1.22.1, file-not-yet-there will not be
created.  But this is not the case with current busybox vi.

                yousong


More information about the busybox mailing list