Thread View: comp.bugs.sys5
1 messages
1 total messages
Started by Amos Shapir
Wed, 28 Jun 1989 13:07
bug in ksh's vi editing
Author: 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)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads