X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/9ec0b715e262f45bb434f2c068a86de2c42528e3..c06981c06286a000c3046af21fb65d07748d8462:/src/dosfns.c diff --git a/src/dosfns.c b/src/dosfns.c index 69c702ed31..240f19c338 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -29,8 +29,8 @@ along with GNU Emacs. If not, see . */ #include "lisp.h" #include "buffer.h" #include "termchar.h" -#include "termhooks.h" #include "frame.h" +#include "termhooks.h" #include "blockinput.h" #include "window.h" #include "dosfns.h" @@ -420,7 +420,7 @@ msdos_stdcolor_idx (const char *name) int i; for (i = 0; i < sizeof (vga_colors) / sizeof (vga_colors[0]); i++) - if (strcasecmp (name, vga_colors[i]) == 0) + if (xstrcasecmp (name, vga_colors[i]) == 0) return i; return @@ -536,15 +536,27 @@ If the underlying system call fails, value is nil. */) void dos_cleanup (void) { + struct tty_display_info *tty; + #ifndef HAVE_X_WINDOWS restore_parent_vm_title (); #endif /* Make sure the termscript file is committed, in case we are crashing and some vital info was written there. */ - if (termscript) + if (FRAMEP (selected_frame)) { - fflush (termscript); - fsync (fileno (termscript)); + struct frame *sf = XFRAME (selected_frame); + + if (FRAME_LIVE_P (sf) + && (FRAME_MSDOS_P (sf) || FRAME_TERMCAP_P (sf))) + { + tty = CURTTY (); + if (tty->termscript) + { + fflush (tty->termscript); + fsync (fileno (tty->termscript)); + } + } } }