---
 io.c        |    2 +-
 main_loop.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

--- ed-0.9.orig/io.c
+++ ed-0.9/io.c
@@ -154,7 +154,7 @@ const char *get_tty_line( int *lenp )
         return ibuf;
         }
       }
-    else
+    else if (c != '\r')
       {
       if( !resize_buffer( &ibuf, &ibufsz, i + 2 ) )
         { if( lenp ) *lenp = 0; return 0; }
--- ed-0.9.orig/main_loop.c
+++ ed-0.9/main_loop.c
@@ -662,7 +662,8 @@ int main_loop( const char loose )
   while( 1 )
     {
     if( status < 0 && verbose ) fprintf( stderr, "%s\n", errmsg );
-    if( prompt_on ) { printf( "%s", prompt_str ); fflush( stdout ); }
+    if( prompt_on ) printf( "%s", prompt_str );
+    fflush( stdout );
     ibufp2 = get_tty_line( &len );
     if( !ibufp2 ) return err_status;	/* { status = ERR; continue; } */
     if( !len )

