3f982c
diff -urN ed-1.14.2/carg_parser.c ed-1.14.2_patched/carg_parser.c
3f982c
--- ed-1.14.2/carg_parser.c	2017-01-12 23:05:08.000000000 +0100
3f982c
+++ ed-1.14.2_patched/carg_parser.c	2018-10-04 11:12:59.857570021 +0200
3f982c
@@ -204,6 +204,8 @@
3f982c
   int non_options_size = 0;		/* number of skipped non-options */
3f982c
   int argind = 1;			/* index in argv */
3f982c
   int i;
3f982c
+  int Status = 0;
3f982c
+  void * tmp = NULL;
3f982c
 
3f982c
   ap->data = 0;
3f982c
   ap->error = 0;
3f982c
@@ -223,9 +225,15 @@
3f982c
       if( ch2 == '-' )
3f982c
         {
3f982c
         if( !argv[argind][2] ) { ++argind; break; }	/* we found "--" */
3f982c
-        else if( !parse_long_option( ap, opt, arg, options, &argind ) ) return 0;
3f982c
+        else if( !parse_long_option( ap, opt, arg, options, &argind ) ) {
3f982c
+          Status = 0;
3f982c
+          goto Exit;
3f982c
+          }
3f982c
         }
3f982c
-      else if( !parse_short_option( ap, opt, arg, options, &argind ) ) return 0;
3f982c
+      else if( !parse_short_option( ap, opt, arg, options, &argind ) ) {
3f982c
+          Status = 0;
3f982c
+          goto Exit;
3f982c
+          }
3f982c
       if( ap->error ) break;
3f982c
       }
3f982c
     else
3f982c
@@ -234,7 +242,7 @@
3f982c
         { if( !push_back_record( ap, 0, argv[argind++] ) ) return 0; }
3f982c
       else
3f982c
         {
3f982c
-        void * tmp = ap_resize_buffer( non_options,
3f982c
+        tmp = ap_resize_buffer( non_options,
3f982c
                        ( non_options_size + 1 ) * sizeof *non_options );
3f982c
         if( !tmp ) return 0;
3f982c
         non_options = (const char **)tmp;
3f982c
@@ -246,12 +254,21 @@
3f982c
   else
3f982c
     {
3f982c
     for( i = 0; i < non_options_size; ++i )
3f982c
-      if( !push_back_record( ap, 0, non_options[i] ) ) return 0;
3f982c
+      if( !push_back_record( ap, 0, non_options[i] ) ) {
3f982c
+        Status = 0;
3f982c
+        goto Exit;
3f982c
+      }
3f982c
     while( argind < argc )
3f982c
-      if( !push_back_record( ap, 0, argv[argind++] ) ) return 0;
3f982c
+      if( !push_back_record( ap, 0, argv[argind++] ) ) {
3f982c
+        Status = 0;
3f982c
+        goto Exit;
3f982c
+      }
3f982c
     }
3f982c
+  Status = 1;
3f982c
+  goto Exit;
3f982c
+Exit:
3f982c
   if( non_options ) free( non_options );
3f982c
-  return 1;
3f982c
+  return(Status);
3f982c
   }
3f982c
 
3f982c
 
3f982c
diff -urN ed-1.14.2/main_loop.c ed-1.14.2_patched/main_loop.c
3f982c
--- ed-1.14.2/main_loop.c	2017-02-22 17:25:34.000000000 +0100
3f982c
+++ ed-1.14.2_patched/main_loop.c	2018-10-01 17:19:46.555004735 +0200
3f982c
@@ -614,7 +614,7 @@
3f982c
                    !print_lines( second_addr, second_addr, 0 ) )
3f982c
                 return ERR;
3f982c
               break;
3f982c
-    case '#': while( *(*ibufpp)++ != '\n' ) ;
3f982c
+    case '#': while( *(*ibufpp)++ != '\n' ) {} ;
3f982c
               break;
3f982c
     default : set_error_msg( "Unknown command" ); return ERR;
3f982c
     }