bug-ed
[Top][All Lists]
Advanced

[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




reply via email to

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