Author: rfm
Date: Tue Mar 25 18:53:04 2014
New Revision: 37765

URL: http://svn.gna.org/viewcvs/gnustep?rev=37765&view=rev
Log:
turn off reading input in on-interactive mode

Modified:
    libs/ec/trunk/EcConsole.m

Modified: libs/ec/trunk/EcConsole.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/ec/trunk/EcConsole.m?rev=37765&r1=37764&r2=37765&view=diff
==============================================================================
--- libs/ec/trunk/EcConsole.m   (original)
+++ libs/ec/trunk/EcConsole.m   Tue Mar 25 18:53:04 2014
@@ -72,6 +72,7 @@
   NSRegularExpression   *fail;
   id                   server;
   int                  pos;
+  BOOL                  interactive;
 }
 - (void) connectionBecameInvalid: (NSNotification*)notification;
 #if defined(HAVE_LIBREADLINE)
@@ -421,7 +422,10 @@
          [data setLength: len - done];
        }
 
-      [ichan readInBackgroundAndNotify];       /* Need more data.      */
+      if (YES == interactive)
+        {
+          [ichan readInBackgroundAndNotify];   /* Need more data.      */
+        }
     }
 }
 #endif
@@ -753,6 +757,7 @@
       NSDictionary      *env = [[NSProcessInfo processInfo] environment];
       NSString          *s;
 
+      interactive = YES;
       local = [[[NSHost currentHost] name] retain];
       name = [defs stringForKey: @"ControlName"];
       if (name == nil)
@@ -790,6 +795,7 @@
 
       if (user && pass)
         {
+          interactive = NO;
          server = [NSConnection rootProxyForConnectionWithRegisteredName: name
            host: host
            usingNameServer: [NSSocketPortNameServer sharedInstance]];
@@ -911,7 +917,7 @@
           ichan = [[NSFileHandle fileHandleWithStandardInput] retain];
           ochan = [[NSFileHandle fileHandleWithStandardOutput] retain];
 #if !defined(HAVE_LIBREADLINE)
-          if (nil == user)
+          if (YES == interactive)
             {
               [[NSNotificationCenter defaultCenter] addObserver: self
                              selector: @selector(didRead:)
@@ -931,8 +937,11 @@
   NSRunLoop    *loop;
 
 #if defined(HAVE_LIBREADLINE)
-  [self setupConnection];
-  [self activateReadline];
+  if (YES == interactive)
+    {
+      [self setupConnection];
+      [self activateReadline];
+    }
 #endif
 
   loop = [NSRunLoop currentRunLoop];
@@ -945,7 +954,10 @@
     }
 
 #if defined(HAVE_LIBREADLINE)
-  [self deactivateReadline];
+  if (YES == interactive)
+    {
+      [self deactivateReadline];
+    }
 #endif
   return 0;
 }


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to