🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #427

Re: SED bug

#427
From: Tapani Tarvainen
Date: Sun, 17 Sep 1989 19:48
28 lines
1280 bytes
In article <1311@tukki.jyu.fi> tarvaine@tukki.jyu.fi I wrote:
>The y-command doesn't seem to work with Gnu SED 1.02

The bug turned out to be that the program assumed that there is
always '\n' at the end of a line, but it can be EOF as well.
Here's my fix:

*** sed.old	Sun Sep 17 22:28:15 1989
--- sed.c	Sun Sep 17 22:42:38 1989
***************
*** 704,710 ****
  				cur_cmd->x.translate[*string++]=ch;
  			}
  			flush_buffer(b);
! 			if(inchar()!=slash || inchar()!='\n')
  				bad_prog(LINE_JUNK);
  			break;
  
--- 704,710 ----
  				cur_cmd->x.translate[*string++]=ch;
  			}
  			flush_buffer(b);
! 			if(inchar()!=slash || ((ch=inchar())!='\n' && ch!=EOF)
  				bad_prog(LINE_JUNK);
  			break;
  
-- 
Tapani Tarvainen    (tarvaine@tukki.jyu.fi, tarvainen@finjyu.bitnet)
Technical Details
Message-ID: <1312@tukki.jyu.fi>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ginosko!uunet!mcsun!sunic!tut!tukki!tarvaine
References: <8909121817.AA11159@gem> <1309@tukki.jyu.fi> <1311@tukki.jyu.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ginosko!uunet!mcsun!sunic!tut!tukki!tarvaine
From: tarvaine@tukki.jyu.fi (Tapani Tarvainen)
Newsgroups: gnu.utils.bug
Subject: Re: SED bug
Message-ID: <1312@tukki.jyu.fi>
Date: 17 Sep 89 19:48:31 GMT
References: <8909121817.AA11159@gem> <1309@tukki.jyu.fi> <1311@tukki.jyu.fi>
Reply-To: tarvaine@tukki.jyu.fi (Tapani Tarvainen)
Distribution: gnu
Organization: University of Jyvaskyla, Finland
Lines: 28