FreeBSD Bugzilla – Attachment 10527 Details for
Bug 21089
[patch] vi(1) silently corrupts open file on SIGINT when entering :wq in command mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
nvi-SIGINT.diff
nvi-SIGINT.diff (text/x-diff; charset=us-ascii), 1.96 KB, created by
Jaakko Heinonen
on 2008-02-12 18:02:25 UTC
(
hide
)
Description:
nvi-SIGINT.diff
Filename:
MIME Type:
Creator:
Jaakko Heinonen
Created:
2008-02-12 18:02:25 UTC
Size:
1.96 KB
patch
obsolete
>Index: common/gs.h >=================================================================== >RCS file: /home/ncvs/src/contrib/nvi/common/gs.h,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 gs.h >--- common/gs.h 1 Nov 1996 06:45:37 -0000 1.1.1.1 >+++ common/gs.h 12 Feb 2008 17:55:35 -0000 >@@ -144,6 +144,7 @@ struct _gs { > #define G_SNAPSHOT 0x0040 /* Always snapshot files. */ > #define G_SRESTART 0x0080 /* Screen restarted. */ > #define G_TMP_INUSE 0x0100 /* Temporary buffer in use. */ >+#define G_RESIZE 0x0200 /* Resize requested. */ > u_int32_t flags; > > /* Screen interface functions. */ >Index: common/key.c >=================================================================== >RCS file: /home/ncvs/src/contrib/nvi/common/key.c,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 key.c >--- common/key.c 1 Nov 1996 06:45:37 -0000 1.1.1.1 >+++ common/key.c 12 Feb 2008 17:55:35 -0000 >@@ -591,6 +591,10 @@ loop: if (gp->scr_event(sp, argp, > if (LF_ISSET(EC_INTERRUPT)) > return (0); > goto append; >+ case E_WRESIZE: >+ /* Set the global resize flag. */ >+ F_SET(sp->gp, G_RESIZE); >+ goto append; > default: > append: if (v_event_append(sp, argp)) > return (1); >Index: vi/v_txt.c >=================================================================== >RCS file: /home/ncvs/src/contrib/nvi/vi/v_txt.c,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 v_txt.c >--- vi/v_txt.c 1 Nov 1996 06:45:33 -0000 1.1.1.1 >+++ vi/v_txt.c 12 Feb 2008 17:55:36 -0000 >@@ -92,6 +92,8 @@ v_tcmd(sp, vp, prompt, flags) > if (O_ISSET(sp, O_TTYWERASE)) > LF_SET(TXT_TTYWERASE); > >+ F_CLR(sp->gp, G_RESIZE); >+ > /* Do the input thing. */ > if (v_txt(sp, vp, NULL, NULL, 0, prompt, 0, 1, flags)) > return (1); >@@ -109,6 +111,10 @@ v_tcmd(sp, vp, prompt, flags) > /* Set the cursor to the resulting position. */ > sp->lno = vp->m_final.lno; > sp->cno = vp->m_final.cno; >+ >+ /* Abort the command on interrupt or window resize. */ >+ if (INTERRUPTED(sp) || F_ISSET(sp->gp, G_RESIZE)) >+ return (1); > > return (0); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 21089
:
10526
| 10527 |
10528
|
10529
|
10530
|
10531
|
10532