bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ed] Infinite loop in ed-0.6 and older


From: Antonio Diaz Diaz
Subject: Re: [Bug-ed] Infinite loop in ed-0.6 and older
Date: Tue, 03 Jul 2007 03:58:32 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Karsten Hopp wrote:
ed enters an infinite loop when there's only one line in the edited file and you're
using the ?re syntax.

I hope this patch fixes it:
---------------------------------------------------------------
--- ../src-0.6/buf.c    2007-06-29 02:10:39.000000000 +0200
+++ buf.c       2007-07-03 03:21:42.000000000 +0200
@@ -64,7 +64,7 @@
   { if( ++addr > _last_addr ) addr = 0; return addr; }

 int dec_addr( int addr )
-  { if( --addr < 0 ) addr = _last_addr - 1; return addr; }
+  { if( --addr < 0 ) addr = _last_addr; return addr; }


 /* link next and previous nodes */
---------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]