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

Comparing rxvt-unicode/src/ptytty.C (file contents):
Revision 1.28 by root, Wed Jan 4 03:02:01 2006 UTC vs.
Revision 1.29 by root, Fri Jan 6 02:11:15 2006 UTC

396 396
397void 397void
398 398
399rxvt_ptytty::close_tty () 399rxvt_ptytty::close_tty ()
400{ 400{
401 if (tty >= 0) close (tty); 401 if (tty < 0)
402 return;
403
404 close (tty);
402 tty = -1; 405 tty = -1;
403} 406}
404 407
405void 408void
406rxvt_ptytty::put () 409rxvt_ptytty::put ()
451 454
452void 455void
453rxvt_ptytty::set_utf8_mode (bool on) 456rxvt_ptytty::set_utf8_mode (bool on)
454{ 457{
455#ifdef IUTF8 458#ifdef IUTF8
456 if (pty != -1) 459 if (pty < 0)
457 { 460 return;
461
458 struct termios tio; 462 struct termios tio;
459 463
460 if (tcgetattr (pty, &tio) != -1) 464 if (tcgetattr (pty, &tio) != -1)
465 {
466 tcflag_t new_cflag = tio.c_iflag;
467
468 if (on)
469 new_cflag |= IUTF8;
470 else
471 new_cflag &= ~IUTF8;
472
473 if (new_cflag != tio.c_iflag)
461 { 474 {
462 tcflag_t new_cflag = tio.c_iflag;
463
464 if (on)
465 new_cflag |= IUTF8;
466 else
467 new_cflag &= ~IUTF8;
468
469 if (new_cflag != tio.c_iflag)
470 {
471 tio.c_iflag = new_cflag; 475 tio.c_iflag = new_cflag;
472 tcsetattr (pty, TCSANOW, &tio); 476 tcsetattr (pty, TCSANOW, &tio);
473 }
474 } 477 }
475 } 478 }
476#endif 479#endif
477} 480}
478 481

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines