repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 803a85f993dc61a661cd37a3c2c8c9a8f0171bf1:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 803a85f993dc61a661cd37a3c2c8c9a8f0171bf1
Author: Marc Lehmann 
Date:   Fri Jan 6 02:11:15 2006 +0000

    *** empty log message ***

diff --git a/src/init.C b/src/init.C
index c2e76c5f7be5159e9fe65da54610b62ac1d9942a..
index ..f0fcffd975048270f932ee5fe90869dd91e54e9a 100644
--- a/src/init.C
+++ b/src/init.C
@@ -1404,11 +1404,14 @@ rxvt_term::run_command (const char *const *argv)
     {
       pty.pty = atoi (rs[Rs_pty_fd]);

-      if (getfd_hook)
-        pty.pty = (*getfd_hook) (pty.pty);
+      if (pty.pty >= 0)
+        {
+          if (getfd_hook)
+            pty.pty = (*getfd_hook) (pty.pty);

-      if (pty.pty < 0 || fcntl (pty.pty, F_SETFL, O_NONBLOCK))
-        rxvt_fatal ("unusable pty-fd filehandle, aborting.\n");
+          if (pty.pty < 0 || fcntl (pty.pty, F_SETFL, O_NONBLOCK))
+            rxvt_fatal ("unusable pty-fd filehandle, aborting.\n");
+        }
     }
   else
 #endif
diff --git a/src/main.C b/src/main.C
index 03c1e64a05203360d8903c0a53edf5c76a49e521..
index ..3578f9fedf966e1cb5f1770a6bed54ca82b7cb3f 100644
--- a/src/main.C
+++ b/src/main.C
@@ -536,7 +536,8 @@ rxvt_term::init (int argc, const char *const *argv)

   free (cmd_argv);

-  pty_ev.start (pty.pty, EVENT_READ);
+  if (pty.pty >= 0)
+    pty_ev.start (pty.pty, EVENT_READ);

   check_ev.start ();

diff --git a/src/ptytty.C b/src/ptytty.C
index f09139153e4796148c2a0f0fcc5274d73eade034..
index ..b56737a749bcb8bb790fbc2344d735a04a0b4786 100644
--- a/src/ptytty.C
+++ b/src/ptytty.C
@@ -398,7 +398,10 @@ void

 rxvt_ptytty::close_tty ()
 {
-  if (tty >= 0) close (tty);
+  if (tty < 0)
+    return;
+
+  close (tty);
   tty = -1;
 }

@@ -453,24 +456,24 @@ void
 rxvt_ptytty::set_utf8_mode (bool on)
 {
 #ifdef IUTF8
-  if (pty != -1)
+  if (pty < 0)
+    return;
+
+  struct termios tio;
+
+  if (tcgetattr (pty, &tio) != -1)
     {
-      struct termios tio;
+      tcflag_t new_cflag = tio.c_iflag;
+
+      if (on)
+        new_cflag |= IUTF8;
+      else
+        new_cflag &= ~IUTF8;

-      if (tcgetattr (pty, &tio) != -1)
+      if (new_cflag != tio.c_iflag)
         {
-          tcflag_t new_cflag = tio.c_iflag;
-
-          if (on)
-            new_cflag |= IUTF8;
-          else
-            new_cflag &= ~IUTF8;
-
-          if (new_cflag != tio.c_iflag)
-            {
-              tio.c_iflag = new_cflag;
-              tcsetattr (pty, TCSANOW, &tio);
-            }
+          tio.c_iflag = new_cflag;
+          tcsetattr (pty, TCSANOW, &tio);
         }
     }
 #endif
diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C
index c35fb73482cca7508a11a434660ee55d0b22e24a..
index ..71025707a6df1464bfc8e7c2ec390da69c495b4d 100644
--- a/src/rxvttoolkit.C
+++ b/src/rxvttoolkit.C
@@ -281,7 +281,6 @@ void rxvt_display::x_cb (io_watcher &w, short revents)
 #ifdef USE_XIM
       if (!XFilterEvent (&xev, None))
         {
-
           if (xev.type == PropertyNotify
               && xev.xany.window == root
               && xev.xproperty.atom == xa_xim_servers)

-----END OF PAGE-----