Article View: comp.bugs.sys5
Article #13bug in ksh's vi editing
From: Amos Shapir
Date: Wed, 28 Jun 1989 13:07
Date: Wed, 28 Jun 1989 13:07
58 lines
1784 bytes
1784 bytes
Index: ksh-i/src/sh/vi.c
Description:
When editing commands in ksh's vi mode, a memory fault occurs which
causes ksh to exit abnormally.
Repeat by:
move to a line containing 7 chars (sometime any odd number would do);
then do
x$rz
(if the bug doesn't appear this should delete the 1st char
and replace the last one by 'z').
Fix:
The 'x' command puts a blank at the end of the line, but forgets
to put the terminating null back in. A patch follows.
*** vi.c Sun Jun 25 11:34:47 1989
--- vi.c.orig Fri Nov 14 03:48:39 1986
***************
*** 1113,1119
virtual[++last_virt] = ' ';
if( mvcursor(motion)==BAD && strchr(";,TtFf", motion) )
{
! virtual[last_virt--] = 0;
return(BAD);
}
virtual[last_virt--] = 0;
--- 1113,1119 -----
virtual[++last_virt] = ' ';
if( mvcursor(motion)==BAD && strchr(";,TtFf", motion) )
{
! --last_virt;
return(BAD);
}
--last_virt;
***************
*** 1116,1122
virtual[last_virt--] = 0;
return(BAD);
}
! virtual[last_virt--] = 0;
j = cur_virt;
if( mode=='c' && j>i )
--- 1116,1122 -----
--last_virt;
return(BAD);
}
! --last_virt;
j = cur_virt;
if( mode=='c' && j>i )
--
Amos Shapir amos@nsc.com
National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel
Tel. +972 52 522261 TWX: 33691, fax: +972-52-558322
34 48 E / 32 10 N (My other cpu is a NS32532)
Technical Details
Message-ID:
<2024@taux01.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!voder!nsc!taux01!amosShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!voder!nsc!taux01!amos From: amos@taux01.UUCP (Amos Shapir) Newsgroups: comp.bugs.sys5,comp.bugs.misc Subject: bug in ksh's vi editing Message-ID: <2024@taux01.UUCP> Date: 28 Jun 89 13:07:31 GMT Organization: National Semiconductor (IC) Ltd, Israel Lines: 58