*** empty log message ***
authorroot <root>
Sun, 22 Jan 2006 00:36:59 +0000 (00:36 +0000)
committerroot <root>
Sun, 22 Jan 2006 00:36:59 +0000 (00:36 +0000)
Changes
src/logging.C
src/main.C
src/ptytty.h
src/rxvt.C
src/rxvt.h
src/rxvtd.C
src/rxvtperl.xs
src/rxvtutil.h

diff --git a/Changes b/Changes
index 8da8ab53783dd5e764b88aaa58fe00000939c01c..6ebdf06a10d3c043c7f0ae21aaa43c5bc2963fbc 100644 (file)
--- a/Changes
+++ b/Changes
@@ -17,6 +17,7 @@ WISH: just for fun, do shade and tint with XRender.
 DUMB: support tex fonts
 
 7.2
+TODO: alsamixer/wild resize => secondary leaks into primary scrollback?
         - bugfix: urxvt (not urxvtd) did not correctly handle multiple
           environments necessary, which resulted in segfaults within
           getenv (reproducable: urxvt -fn 9x15, open a menu once,
index 94fdee65f124c34cb89c19082eb4a991d28577f9..465e3be15f8ef652dd0d0926152e8b0452bc828d 100644 (file)
@@ -449,4 +449,9 @@ rxvt_update_lastlog (const char *fname, const char *pty, const char *host)
 #endif                         /* LASTLOG_SUPPORT */
 /* ------------------------------------------------------------------------- */
 
+#else
+void
+rxvt_ptytty_unix::login (int cmd_pid, bool login_shell, const char *hostname)
+{
+}
 #endif                         /* UTMP_SUPPORT */
index 8290a3284f80b33895a017d88f62e6ddeef37624..b2203d21ff061e83f17cd02c6c1ddfa4496cea0e 100644 (file)
@@ -452,8 +452,10 @@ rxvt_xioerror_handler (Display *display)
 
 /*----------------------------------------------------------------------*/
 bool
-rxvt_term::init (int argc, const char *const *argv)
+rxvt_term::init (int argc, const char *const *argv, stringvec *envv)
 {
+  this->envv = envv;
+
   SET_R (this);
   set_locale ("");
   set_environ (envv); // few things in X do not call setlocale :(
index 4025a8e71a85846467577965d2dddc874e3e7691..0b76250161a78ffaea8baf91c61ba4f04d38ecf4 100644 (file)
@@ -58,6 +58,8 @@ public:
   bool get ();
   void put ();
 
+  void login (int cmd_pid, bool login_shell, const char *hostname);
+
 #if UTMP_SUPPORT
   int utmp_pos;
   int cmd_pid;
@@ -73,7 +75,6 @@ public:
   char ut_id[5];
 #endif
 
-  void login (int cmd_pid, bool login_shell, const char *hostname);
   void logout ();
 #endif
 };
index 617c7c8e4cee5b844c19d72b6aacf845975071ea..9d4b829ab87211d4813c24b06a93a469f4881081 100644 (file)
 #include "../config.h"
 #include "rxvt.h"
 
+#include <cstdlib>
+#include <cstring>
+
 int
 main (int argc, const char *const *argv)
 try
   {
     rxvt_init ();
 
+    stringvec *envv = new stringvec;
+
+    for (char **var = environ; *var; var++)
+      envv->push_back (strdup (*var));
+
+    envv->push_back (0);
+
     rxvt_term *t = new rxvt_term;
 
-    if (!t->init (argc, argv))
+    if (!t->init (argc, argv, envv))
       return EXIT_FAILURE;
 
     io_manager::loop ();
index 963456f69c870cd8dfbc5029f11d5fe029076096..708779ffd581d1e5030cbb395b3073892aeda3bf 100644 (file)
@@ -143,6 +143,7 @@ char *           rxvt_wcstombs                    (const wchar_t *str, int len =
 wchar_t *        rxvt_mbstowcs                    (const char *str, int len = -1);
 char *           rxvt_wcstoutf8                   (const wchar_t *str, int len = -1);
 wchar_t *        rxvt_utf8towcs                   (const char *str, int len = -1);
+char *           rxvt_strdup_cpp                  (const char *str);
 
 #define rxvt_strdup(s) ((s) ? strdup(s) : 0)
 
@@ -216,9 +217,7 @@ struct rxvt_ptytty {
   }
 
   virtual bool get () = 0;
-#if UTMP_SUPPORT
   virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
-#endif
 
   void close_tty ();
   bool make_controlling_tty ();
@@ -1239,7 +1238,14 @@ struct rxvt_term : zero_initialized, rxvt_vars {
   void destroy ();
   void emergency_cleanup ();
 
-  bool init (int argc, const char *const *argv);
+  bool init (int argc, const char *const *argv, stringvec *envv);
+
+  bool init (stringvec *argv, stringvec *envv)
+  {
+    this->argv = argv;
+    return init (argv->size (), argv->begin (), envv);
+  }
+  
   bool init_vars ();
 
   bool pty_fill ();
index f55ce910563a78d0bc8e2c9290ab1bb97fd76711..4758132d5c91f72cb9a7a865cf106cb0e200ee61 100644 (file)
@@ -168,7 +168,7 @@ void server::read_cb (io_watcher &w, short revents)
               if (!strcmp (tok, "END"))
                 break;
               else if (!strcmp (tok, "ENV") && recv (tok))
-                envv->push_back (tok.get ());
+                envv->push_back (strdup (tok));
               else if (!strcmp (tok, "CWD") && recv (tok))
                 {
                   if (chdir (tok))
@@ -176,7 +176,7 @@ void server::read_cb (io_watcher &w, short revents)
                          (char *)tok, strerror (errno));
                 }
               else if (!strcmp (tok, "ARG") && recv (tok))
-                argv->push_back (tok.get ());
+                argv->push_back (strdup (tok));
               else
                 return err ("protocol error: unexpected NEW token");
             }
@@ -188,14 +188,12 @@ void server::read_cb (io_watcher &w, short revents)
             
             term->log_hook = &log_cb;
             term->getfd_hook = &getfd_cb;
-            term->argv = argv;
-            term->envv = envv;
 
             bool success;
             
             try
               {
-                success = term->init (argv->size (), argv->begin ());
+                success = term->init (argv, envv);
               }
             catch (const class rxvt_failure_exception &e)
               {
index 64ffdb82d9795a11f7f50c4e5963d9dc8042f739..6a3249353de29432abd284df6c96aef980a12e99 100644 (file)
@@ -930,23 +930,23 @@ _new (...)
 
         rxvt_term *term = new rxvt_term;
 
-       term->argv = new stringvec;
-       term->envv = new stringvec;
+       stringvec *argv = new stringvec;
+       stringvec *envv = new stringvec;
 
         for (int i = 1; i < items; i++)
-          term->argv->push_back (strdup (SvPVbyte_nolen (ST (i))));
+          argv->push_back (strdup (SvPVbyte_nolen (ST (i))));
 
-        AV *envv = (AV *)SvRV (ST (0));
-        for (int i = AvFILL (envv) + 1; i--; )
-          term->envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (envv, i, 1))));
+        AV *env = (AV *)SvRV (ST (0));
+        for (int i = AvFILL (env) + 1; i--; )
+          envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1))));
 
-        term->envv->push_back (0);
+        envv->push_back (0);
 
         bool success;
 
         try
           {
-            success = term->init (term->argv->size (), term->argv->begin ());
+            success = term->init (argv, envv);
           }
         catch (const class rxvt_failure_exception &e)
           {
index a16a4b286b43cf540d33c426c426ebcb3ed81ff1..2e62cc36020bfded7b63610100041367cb4c9841 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef RXVT_UTIL_H
 #define RXVT_UTIL_H
 
+#include <cstdlib>
 #include <cstring>
 
 #define PP_CONCAT_(a, b) a ## b
@@ -393,7 +394,7 @@ struct stringvec : simplevec<char *>
   ~stringvec ()
   {
     for (char **c = begin (); c != end (); c++)
-      delete [] *c;
+      free (*c);
   }
 };