diff options
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c index 82b30b18af0..04d5f74fc2c 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -2424,6 +2424,7 @@ init_tty (char *name, char *terminal_type, int must_succeed) | |||
| 2424 | "Unknown terminal type", | 2424 | "Unknown terminal type", |
| 2425 | "Unknown terminal type"); | 2425 | "Unknown terminal type"); |
| 2426 | 2426 | ||
| 2427 | #ifndef WINDOWSNT | ||
| 2427 | if (name == NULL) | 2428 | if (name == NULL) |
| 2428 | name = "/dev/tty"; | 2429 | name = "/dev/tty"; |
| 2429 | if (!strcmp (name, "/dev/tty")) | 2430 | if (!strcmp (name, "/dev/tty")) |
| @@ -2437,7 +2438,8 @@ init_tty (char *name, char *terminal_type, int must_succeed) | |||
| 2437 | terminal = get_named_tty (name); | 2438 | terminal = get_named_tty (name); |
| 2438 | if (terminal) | 2439 | if (terminal) |
| 2439 | return terminal; | 2440 | return terminal; |
| 2440 | 2441 | #endif | |
| 2442 | |||
| 2441 | terminal = create_terminal (); | 2443 | terminal = create_terminal (); |
| 2442 | tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info)); | 2444 | tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info)); |
| 2443 | bzero (tty, sizeof (struct tty_display_info)); | 2445 | bzero (tty, sizeof (struct tty_display_info)); |
| @@ -2451,6 +2453,7 @@ init_tty (char *name, char *terminal_type, int must_succeed) | |||
| 2451 | tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm)); | 2453 | tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm)); |
| 2452 | Wcm_clear (tty); | 2454 | Wcm_clear (tty); |
| 2453 | 2455 | ||
| 2456 | #ifndef WINDOWSNT | ||
| 2454 | set_tty_hooks (terminal); | 2457 | set_tty_hooks (terminal); |
| 2455 | 2458 | ||
| 2456 | { | 2459 | { |
| @@ -2497,19 +2500,33 @@ init_tty (char *name, char *terminal_type, int must_succeed) | |||
| 2497 | tty->input = file; | 2500 | tty->input = file; |
| 2498 | tty->output = file; | 2501 | tty->output = file; |
| 2499 | } | 2502 | } |
| 2500 | 2503 | ||
| 2501 | tty->type = xstrdup (terminal_type); | 2504 | tty->type = xstrdup (terminal_type); |
| 2502 | 2505 | ||
| 2503 | add_keyboard_wait_descriptor (fileno (tty->input)); | 2506 | add_keyboard_wait_descriptor (fileno (tty->input)); |
| 2504 | 2507 | ||
| 2508 | #endif | ||
| 2509 | |||
| 2505 | encode_terminal_bufsize = 0; | 2510 | encode_terminal_bufsize = 0; |
| 2506 | 2511 | ||
| 2507 | #ifdef WINDOWSNT | 2512 | #ifdef WINDOWSNT |
| 2508 | initialize_w32_display (); | 2513 | initialize_w32_display (); |
| 2509 | 2514 | ||
| 2515 | /* XXX Can this be non-null? */ | ||
| 2516 | if (name) | ||
| 2517 | { | ||
| 2518 | tty->name = xstrdup (name); | ||
| 2519 | terminal->name = xstrdup (name); | ||
| 2520 | } | ||
| 2521 | tty->type = xstrdup (terminal_type); | ||
| 2522 | |||
| 2523 | /* XXX not sure if this line is correct. If it is not set then we | ||
| 2524 | crash in update_display_1. */ | ||
| 2525 | tty->output = stdout; | ||
| 2526 | |||
| 2510 | Wcm_clear (tty); | 2527 | Wcm_clear (tty); |
| 2511 | 2528 | ||
| 2512 | area = (char *) xmalloc (2044); | 2529 | area = (char *) xmalloc (2044); /* XXX this seems unused. */ |
| 2513 | 2530 | ||
| 2514 | { | 2531 | { |
| 2515 | struct frame *f = XFRAME (selected_frame); | 2532 | struct frame *f = XFRAME (selected_frame); |