aboutsummaryrefslogtreecommitdiffstats
path: root/src/msdos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/msdos.c')
-rw-r--r--src/msdos.c55
1 files changed, 35 insertions, 20 deletions
diff --git a/src/msdos.c b/src/msdos.c
index c4e9197ab49..d0de02aba3f 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */
40#include <unistd.h> /* for chdir, dup, dup2, etc. */ 40#include <unistd.h> /* for chdir, dup, dup2, etc. */
41#include <dir.h> /* for getdisk */ 41#include <dir.h> /* for getdisk */
42#if __DJGPP__ >= 2 42#if __DJGPP__ >= 2
43#pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */
43#include <fcntl.h> 44#include <fcntl.h>
44#include <io.h> /* for setmode */ 45#include <io.h> /* for setmode */
45#include <dpmi.h> /* for __dpmi_xxx stuff */ 46#include <dpmi.h> /* for __dpmi_xxx stuff */
@@ -950,8 +951,8 @@ static void
950IT_write_glyphs (struct glyph *str, int str_len) 951IT_write_glyphs (struct glyph *str, int str_len)
951{ 952{
952 unsigned char *screen_buf, *screen_bp, *screen_buf_end, *bp; 953 unsigned char *screen_buf, *screen_bp, *screen_buf_end, *bp;
953 int unsupported_face = FAST_GLYPH_FACE (Vdos_unsupported_char_glyph); 954 int unsupported_face = 0;
954 unsigned unsupported_char= FAST_GLYPH_CHAR (Vdos_unsupported_char_glyph); 955 unsigned unsupported_char = '\177';
955 int offset = 2 * (new_pos_X + screen_size_X * new_pos_Y); 956 int offset = 2 * (new_pos_X + screen_size_X * new_pos_Y);
956 register int sl = str_len; 957 register int sl = str_len;
957 register int tlen = GLYPH_TABLE_LENGTH; 958 register int tlen = GLYPH_TABLE_LENGTH;
@@ -977,6 +978,13 @@ IT_write_glyphs (struct glyph *str, int str_len)
977 978
978 if (str_len <= 0) return; 979 if (str_len <= 0) return;
979 980
981 /* Set up the unsupported character glyph */
982 if (!NILP (Vdos_unsupported_char_glyph))
983 {
984 unsupported_char = FAST_GLYPH_CHAR (XINT (Vdos_unsupported_char_glyph));
985 unsupported_face = FAST_GLYPH_FACE (XINT (Vdos_unsupported_char_glyph));
986 }
987
980 screen_buf = screen_bp = alloca (str_len * 2); 988 screen_buf = screen_bp = alloca (str_len * 2);
981 screen_buf_end = screen_buf + str_len * 2; 989 screen_buf_end = screen_buf + str_len * 2;
982 sf = SELECTED_FRAME(); 990 sf = SELECTED_FRAME();
@@ -1041,7 +1049,7 @@ IT_write_glyphs (struct glyph *str, int str_len)
1041 if (! CHAR_VALID_P (ch, 0)) 1049 if (! CHAR_VALID_P (ch, 0))
1042 { 1050 {
1043 g = !NILP (Vdos_unsupported_char_glyph) 1051 g = !NILP (Vdos_unsupported_char_glyph)
1044 ? Vdos_unsupported_char_glyph 1052 ? XINT (Vdos_unsupported_char_glyph)
1045 : MAKE_GLYPH (sf, '\177', GLYPH_FACE (sf, g)); 1053 : MAKE_GLYPH (sf, '\177', GLYPH_FACE (sf, g));
1046 ch = FAST_GLYPH_CHAR (g); 1054 ch = FAST_GLYPH_CHAR (g);
1047 } 1055 }
@@ -1571,7 +1579,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1571 { 1579 {
1572 extern Lisp_Object Qmouse_face; 1580 extern Lisp_Object Qmouse_face;
1573 Lisp_Object mouse_face, overlay, position, *overlay_vec; 1581 Lisp_Object mouse_face, overlay, position, *overlay_vec;
1574 int len, noverlays, obegv, ozv;; 1582 int noverlays, obegv, ozv;;
1575 struct buffer *obuf; 1583 struct buffer *obuf;
1576 1584
1577 /* If we get an out-of-range value, return now; avoid an error. */ 1585 /* If we get an out-of-range value, return now; avoid an error. */
@@ -1590,20 +1598,8 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1590 /* Is this char mouse-active or does it have help-echo? */ 1598 /* Is this char mouse-active or does it have help-echo? */
1591 XSETINT (position, pos); 1599 XSETINT (position, pos);
1592 1600
1593 /* Put all the overlays we want in a vector in overlay_vec. 1601 /* Put all the overlays we want in a vector in overlay_vec. */
1594 Store the length in len. If there are more than 10, make 1602 GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0);
1595 enough space for all, and try again. */
1596 len = 10;
1597 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
1598 noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL, 0);
1599 if (noverlays > len)
1600 {
1601 len = noverlays;
1602 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
1603 noverlays = overlays_at (pos,
1604 0, &overlay_vec, &len, NULL, NULL, 0);
1605 }
1606
1607 /* Sort overlays into increasing priority order. */ 1603 /* Sort overlays into increasing priority order. */
1608 noverlays = sort_overlays (overlay_vec, noverlays, w); 1604 noverlays = sort_overlays (overlay_vec, noverlays, w);
1609 1605
@@ -4408,9 +4404,28 @@ init_environment (argc, argv, skip_args)
4408 for (i = 0; i < imax ; i++) 4404 for (i = 0; i < imax ; i++)
4409 { 4405 {
4410 const char *tmp = tempdirs[i]; 4406 const char *tmp = tempdirs[i];
4407 char buf[FILENAME_MAX];
4411 4408
4412 if (*tmp == '$') 4409 if (*tmp == '$')
4413 tmp = getenv (tmp + 1); 4410 {
4411 int tmp_len;
4412
4413 tmp = getenv (tmp + 1);
4414 if (!tmp)
4415 continue;
4416
4417 /* Some lusers set TMPDIR=e:, probably because some losing
4418 programs cannot handle multiple slashes if they use e:/.
4419 e: fails in `access' below, so we interpret e: as e:/. */
4420 tmp_len = strlen(tmp);
4421 if (tmp[tmp_len - 1] != '/' && tmp[tmp_len - 1] != '\\')
4422 {
4423 strcpy(buf, tmp);
4424 buf[tmp_len++] = '/', buf[tmp_len] = 0;
4425 tmp = buf;
4426 }
4427 }
4428
4414 /* Note that `access' can lie to us if the directory resides on a 4429 /* Note that `access' can lie to us if the directory resides on a
4415 read-only filesystem, like CD-ROM or a write-protected floppy. 4430 read-only filesystem, like CD-ROM or a write-protected floppy.
4416 The only way to be really sure is to actually create a file and 4431 The only way to be really sure is to actually create a file and
@@ -5272,7 +5287,7 @@ syms_of_msdos ()
5272 DEFVAR_LISP ("dos-unsupported-char-glyph", &Vdos_unsupported_char_glyph, 5287 DEFVAR_LISP ("dos-unsupported-char-glyph", &Vdos_unsupported_char_glyph,
5273 doc: /* *Glyph to display instead of chars not supported by current codepage. 5288 doc: /* *Glyph to display instead of chars not supported by current codepage.
5274This variable is used only by MSDOS terminals. */); 5289This variable is used only by MSDOS terminals. */);
5275 Vdos_unsupported_char_glyph = '\177'; 5290 Vdos_unsupported_char_glyph = make_number ('\177');
5276 5291
5277#endif 5292#endif
5278#ifndef subprocesses 5293#ifndef subprocesses