vi: avoid touching a new file with ZZ when no editing has been done
authorYousong Zhou <yszhou4tech@gmail.com>
Fri, 24 Mar 2017 20:13:10 +0000 (21:13 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 24 Mar 2017 20:13:10 +0000 (21:13 +0100)
commit8f3bf4f0d3605b50a8e4c48c89aeabc455f04884
tree2d0dbeef548eacb8880414da450f067741de87d0
parente3b65ab43d2e2d097a4cd2ee5aa1e1606a8a0663
vi: avoid touching a new file with ZZ when no editing has been done

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@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/vi.c