--- rxvt-unicode/src/rxvtd.C 2011/02/21 07:41:02 1.56 +++ rxvt-unicode/src/rxvtd.C 2012/06/12 10:45:53 1.60 @@ -21,10 +21,10 @@ *----------------------------------------------------------------------*/ #include "../config.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ # include #endif -#include +#include #include "rxvt.h" #include "rxvtdaemon.h" @@ -188,8 +188,6 @@ return err ("protocol error: unexpected NEW token.\n"); } - envv->push_back (0); - { rxvt_term *term = new rxvt_term; @@ -225,11 +223,14 @@ } int -main (int argc, const char *const *argv) +main (int argc, char *argv[]) { ptytty::init (); static char opt_fork, opt_opendisplay, opt_quiet; +#if ENABLE_PERL + static char *opt_eval; +#endif #if ENABLE_MLOCK static char opt_lock; #endif @@ -246,6 +247,10 @@ else if (!strcmp (argv [i], "-m") || !strcmp (argv [i], "--mlock")) opt_lock = 1; #endif +#if ENABLE_PERL + else if (!strcmp (argv [i], "-e") || !strcmp (argv [i], "--eval")) + opt_eval = argv [++i]; +#endif else { rxvt_log ("%s: unknown option '%s', aborting.\n", argv [0], argv [i]); @@ -255,6 +260,14 @@ rxvt_init (); +#if ENABLE_PERL + if (opt_eval) + { + rxvt_perl.init (); + rxvt_perl.eval (opt_eval); + } +#endif + // optionally open display and never release it. if (opt_opendisplay) if (const char *dpy = getenv ("DISPLAY"))