ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/init.C
(Generate patch)

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.134 by root, Fri Jan 6 05:37:59 2006 UTC vs.
Revision 1.139 by root, Wed Jan 11 03:13:26 2006 UTC

339 rs[Rs_name] = rxvt_r_basename (argv[0]); 339 rs[Rs_name] = rxvt_r_basename (argv[0]);
340 340
341 /* 341 /*
342 * Open display, get options/resources and create the window 342 * Open display, get options/resources and create the window
343 */ 343 */
344 {
345 TEMP_ENV;
346
344 if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) 347 if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL)
345 rs[Rs_display_name] = ":0"; 348 rs[Rs_display_name] = ":0";
346 349
347 get_options (r_argc, r_argv); 350 get_options (r_argc, r_argv);
348 351
349 if (!(display = displays.get (rs[Rs_display_name]))) 352 if (!(display = displays.get (rs[Rs_display_name])))
350 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); 353 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]);
351 354
352 extract_resources (); 355 extract_resources ();
356 }
357
353 free (r_argv); 358 free (r_argv);
354 359
355 /* 360 /*
356 * set any defaults not already set 361 * set any defaults not already set
357 */ 362 */
391 pointerBlankDelay = 2; 396 pointerBlankDelay = 2;
392#endif 397#endif
393 398
394 /* no point having a scrollbar without having any scrollback! */ 399 /* no point having a scrollbar without having any scrollback! */
395 if (!saveLines) 400 if (!saveLines)
396 CLR_OPTION (Opt_scrollBar); 401 set_option (Opt_scrollBar, 0);
397 402
398#ifdef PRINTPIPE 403#ifdef PRINTPIPE
399 if (!rs[Rs_print_pipe]) 404 if (!rs[Rs_print_pipe])
400 rs[Rs_print_pipe] = PRINTPIPE; 405 rs[Rs_print_pipe] = PRINTPIPE;
401#endif 406#endif
576 * This should support all European type languages. 581 * This should support all European type languages.
577 */ 582 */
578void 583void
579rxvt_term::set_locale (const char *locale) 584rxvt_term::set_locale (const char *locale)
580{ 585{
586 TEMP_ENV;
587
581#if HAVE_XSETLOCALE || HAVE_SETLOCALE 588#if HAVE_XSETLOCALE || HAVE_SETLOCALE
582 free (this->locale); 589 free (this->locale);
583 this->locale = setlocale (LC_CTYPE, locale); 590 this->locale = setlocale (LC_CTYPE, locale);
584 591
585 if (!this->locale) 592 if (!this->locale)
586 { 593 {
587 if (*locale) 594 if (*locale)
588 { 595 {
589 rxvt_warn ("unable to set locale \"%s\", using default locale instead.\n", locale); 596 rxvt_warn ("unable to set locale \"%s\", using C locale instead.\n", locale);
590 setlocale (LC_CTYPE, ""); 597 setlocale (LC_CTYPE, "C");
591 } 598 }
592 else 599 else
593 rxvt_warn ("default locale unavailable, check LC_* and LANG variables. Continuing.\n"); 600 rxvt_warn ("default locale unavailable, check LC_* and LANG variables. Continuing.\n");
594 601
595 this->locale = ""; 602 this->locale = "C";
596 } 603 }
597 604
598 605
599 this->locale = rxvt_strdup (this->locale); 606 this->locale = rxvt_strdup (this->locale);
600 SET_LOCALE (this->locale); 607 SET_LOCALE (this->locale);
615} 622}
616 623
617void 624void
618rxvt_term::init_xlocale () 625rxvt_term::init_xlocale ()
619{ 626{
627 TEMP_ENV;
628
620#ifdef USE_XIM 629#ifdef USE_XIM
621 if (!locale) 630 if (!locale)
622 rxvt_warn ("setting locale failed, working without locale support.\n"); 631 rxvt_warn ("setting locale failed, working without locale support.\n");
623 else 632 else
624 { 633 {
1091 1100
1092 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; 1101 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
1093 1102
1094 if (OPTION (Opt_pointerBlank) 1103 if (OPTION (Opt_pointerBlank)
1095#ifdef ENABLE_PERL 1104#ifdef ENABLE_PERL
1096 || self 1105 || perl.self
1097#endif 1106#endif
1098 ) 1107 )
1099 vt_emask |= PointerMotionMask; 1108 vt_emask |= PointerMotionMask;
1100 else 1109 else
1101 vt_emask |= Button1MotionMask | Button3MotionMask; 1110 vt_emask |= Button1MotionMask | Button3MotionMask;
1404 * the slave. 1413 * the slave.
1405 */ 1414 */
1406void 1415void
1407rxvt_term::run_command (const char *const *argv) 1416rxvt_term::run_command (const char *const *argv)
1408{ 1417{
1418 TEMP_ENV; // not very temporary...
1419
1409#if ENABLE_FRILLS 1420#if ENABLE_FRILLS
1410 if (rs[Rs_pty_fd]) 1421 if (rs[Rs_pty_fd])
1411 { 1422 {
1412 pty.pty = atoi (rs[Rs_pty_fd]); 1423 pty.pty = atoi (rs[Rs_pty_fd]);
1413 1424
1580 execvp (argv[0], (char *const *)argv); 1591 execvp (argv[0], (char *const *)argv);
1581 /* no error message: STDERR is closed! */ 1592 /* no error message: STDERR is closed! */
1582 } 1593 }
1583 else 1594 else
1584 { 1595 {
1585 const char *argv0, *shell; 1596 const char *argv0, *shell;
1586 1597
1587 if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') 1598 if ((shell = getenv ("SHELL")) == NULL || *shell == '\0')
1588 shell = "/bin/sh"; 1599 shell = "/bin/sh";
1589 1600
1590 argv0 = (const char *)rxvt_r_basename (shell); 1601 argv0 = (const char *)rxvt_r_basename (shell);
1595 1606
1596 login[0] = '-'; 1607 login[0] = '-';
1597 strcpy (&login[1], argv0); 1608 strcpy (&login[1], argv0);
1598 argv0 = login; 1609 argv0 = login;
1599 } 1610 }
1611
1600 execlp (shell, argv0, NULL); 1612 execlp (shell, argv0, NULL);
1601 /* no error message: STDERR is closed! */ 1613 /* no error message: STDERR is closed! */
1602 } 1614 }
1603 1615
1604#else /* __QNX__ uses qnxspawn () */ 1616#else /* __QNX__ uses qnxspawn () */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines