aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-01-08 09:17:27 +0000
committerRichard M. Stallman1994-01-08 09:17:27 +0000
commit23a71bd66dda40f5c2c31bb3ae9ea5f4c00be33b (patch)
treeebf7b3c105f5037e87d89dc37a1ee695ac3f4e8b /src
parenta3fc523600c39361b2f4910cdfa111fe9b57a01c (diff)
downloademacs-23a71bd66dda40f5c2c31bb3ae9ea5f4c00be33b.tar.gz
emacs-23a71bd66dda40f5c2c31bb3ae9ea5f4c00be33b.zip
[MSDOS]: Use text mode for all files but ".elc" files.
(complete_file_name) [MSDOS]: Drive letter support.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c
index d43bb5542f0..ee18ae5ac2b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -47,6 +47,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
47#ifdef STDC_HEADERS 47#ifdef STDC_HEADERS
48#include <stdlib.h> 48#include <stdlib.h>
49#endif 49#endif
50
51#if 0 /* That is untrue--XINT is used below, and it uses INTBITS.
52 What in the world is values.h, anyway? */
53#ifdef MSDOS
54/* These are redefined in <values.h> and not used here */
55#undef INTBITS
56#undef LONGBITS
57#undef SHORTBITS
58#endif
59#endif
60
50#include <math.h> 61#include <math.h>
51#endif /* LISP_FLOAT_TYPE */ 62#endif /* LISP_FLOAT_TYPE */
52 63
@@ -319,6 +330,9 @@ Return t if file exists.")
319 /* 1 means inhibit the message at the beginning. */ 330 /* 1 means inhibit the message at the beginning. */
320 int nomessage1 = 0; 331 int nomessage1 = 0;
321 Lisp_Object handler; 332 Lisp_Object handler;
333#ifdef MSDOS
334 char *dosmode = "rt";
335#endif
322 336
323 CHECK_STRING (str, 0); 337 CHECK_STRING (str, 0);
324 str = Fsubstitute_in_file_name (str); 338 str = Fsubstitute_in_file_name (str);
@@ -352,6 +366,9 @@ Return t if file exists.")
352 struct stat s1, s2; 366 struct stat s1, s2;
353 int result; 367 int result;
354 368
369#ifdef MSDOS
370 dosmode = "rb";
371#endif
355 stat (XSTRING (found)->data, &s1); 372 stat (XSTRING (found)->data, &s1);
356 XSTRING (found)->data[XSTRING (found)->size - 1] = 0; 373 XSTRING (found)->data[XSTRING (found)->size - 1] = 0;
357 result = stat (XSTRING (found)->data, &s2); 374 result = stat (XSTRING (found)->data, &s2);
@@ -366,7 +383,12 @@ Return t if file exists.")
366 XSTRING (found)->data[XSTRING (found)->size - 1] = 'c'; 383 XSTRING (found)->data[XSTRING (found)->size - 1] = 'c';
367 } 384 }
368 385
386#ifdef MSDOS
387 close (fd);
388 stream = fopen ((char *) XSTRING (found)->data, dosmode);
389#else
369 stream = fdopen (fd, "r"); 390 stream = fdopen (fd, "r");
391#endif
370 if (stream == 0) 392 if (stream == 0)
371 { 393 {
372 close (fd); 394 close (fd);
@@ -422,6 +444,9 @@ complete_filename_p (pathname)
422#ifdef VMS 444#ifdef VMS
423 || index (s, ':') 445 || index (s, ':')
424#endif /* VMS */ 446#endif /* VMS */
447#ifdef MSDOS /* MW, May 1993 */
448 || (s[0] != '\0' && s[1] == ':' && s[2] == '/')
449#endif
425 ); 450 );
426} 451}
427 452