[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Invoking as 'ed - filename' broken in ed-0.3-pre[12]
From: |
Andreas Gruenbacher |
Subject: |
Invoking as 'ed - filename' broken in ed-0.3-pre[12] |
Date: |
Mon, 9 Oct 2006 22:30:26 +0200 |
User-agent: |
KMail/1.9.1 |
Invoking ed as `ed - filename', as GNU patch does for ed-style patches, fails
with exit status 2 in ed-0.3-pre[12]. This patch changes the behavior back to
ed-0.2.
Index: main.c
===================================================================
--- main.c.orig
+++ main.c
@@ -152,10 +152,14 @@ int main( int argc, char *argv[] )
setlocale( LC_ALL, "" );
init_buffers();
+ if( optind < argc && !strcmp( argv[optind], "-" ) )
+ {
+ scripted = 1;
+ optind++;
+ }
if( optind < argc )
{
- if( !strcmp( argv[optind], "-" ) ) scripted = 1;
- else if( is_valid_filename( argv[optind], restricted ) )
+ if( is_valid_filename( argv[optind], restricted ) )
{
if( read_file( argv[optind], 0, scripted ) < 0 &&
is_regular_file( 0 ) )
quit( 2 );
Regards,
Andreas
--
Andreas Gruenbacher <address@hidden>
Novell / SUSE Labs
- Invoking as 'ed - filename' broken in ed-0.3-pre[12],
Andreas Gruenbacher <=
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], Antonio Diaz Diaz, 2006/10/11
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], John Cowan, 2006/10/11
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], Paul Eggert, 2006/10/12
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], Antonio Diaz Diaz, 2006/10/20
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], John Cowan, 2006/10/20
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], Antonio Diaz Diaz, 2006/10/21
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], John Cowan, 2006/10/21
- Re: Invoking as 'ed - filename' broken in ed-0.3-pre[12], Antonio Diaz Diaz, 2006/10/21