On Mon, Feb 20, 2017 at 7:12 PM, Yousong Zhou <yszhou4t...@gmail.com> wrote:
> On 20 February 2017 at 19:02, Kang-Che Sung <explore...@gmail.com> wrote:
>> On Mon, Feb 20, 2017 at 4:40 PM, Yousong Zhou <yszhou4t...@gmail.com> wrote:
>>> On 13 February 2017 at 11:00, Yousong Zhou <yszhou4t...@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 <yszhou4t...@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.
>

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.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to