Applied, thank you
On Wed, Jun 8, 2022 at 9:52 PM Grob Grobmann <[email protected]> wrote: > > Busybox vi provides the 'ZZ' command to save and close > the similar 'ZQ' command just exits without saving > I propose this small patch to add that command. > > diff --git a/editors/vi.c b/editors/vi.c > index 3dbe5b471..2357caa5d 100644 > --- a/editors/vi.c > +++ b/editors/vi.c > @@ -4290,8 +4290,14 @@ static void do_cmd(int c) > goto dc_i; // start inserting > break; > case 'Z': // Z- if modified, {write}; exit > - // ZZ means to save file (if necessary), then exit > c1 = get_one_char(); > + // ZQ means to exit without saving > + if (c1 == 'Q') { > + editing=0; > + optind = cmdline_filecnt; > + break; > + } > + // ZZ means to save file (if necessary), then exit > if (c1 != 'Z') { > indicate_error(); > break; > > Cheers > _______________________________________________ > busybox mailing list > [email protected] > http://lists.busybox.net/mailman/listinfo/busybox _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
