On 20 February 2017 at 19:30, Kang-Che Sung <[email protected]> wrote:
> On Mon, Feb 20, 2017 at 7:12 PM, Yousong Zhou <[email protected]> wrote:
>> On 20 February 2017 at 19:02, Kang-Che Sung <[email protected]> wrote:
>>> On Mon, Feb 20, 2017 at 4:40 PM, Yousong Zhou <[email protected]> wrote:
>>>> On 13 February 2017 at 11:00, Yousong Zhou <[email protected]> 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 <[email protected]>
>>>>> ---
>>>>> 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.
>>
>
> So it's a bug on marking the file as dirty when it's unnecessary.
> I've done another test on vim and "busybox vi":
>
> $ echo hello >test.txt
> $ ls -l --full-time test.txt
> -rw-rw-r-- 1 explorer explorer 6 2017-02-20 19:25:30.420641710
> +0800 test.txt
> $ vim test.txt ; ls -l --full-time test.txt
> (type :x in vim screen)
> -rw-rw-r-- 1 explorer explorer 6 2017-02-20 19:25:30.420641710
> +0800 test.txt
> $ ./busybox vi test.txt ; ls -l --full-time test.txt
> (type :x in busybox vi screen)
> -rw-rw-r-- 1 explorer explorer 6 2017-02-20 19:27:12.412637163
> +0800 test.txt
>
> See that the file has been touched even I didn't edit it. In other
> words, :x (and the
> equivalent ZZ command) has been broken.
Well, I guess :x and ZZ are different since the early days of busybox
vi: it's the case with 1.20.0 and 1.22.1. The case with ZZ is more
substantial both as a regression and as a flaw even when looking it
alone without comparison with the standard vim.
yousong
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox