Commit 229ba775 authored by Eli Zaretskii's avatar Eli Zaretskii

(Fload): Rename dosmode to fmode and use it on all

platforms.  Avoid calling fdopen only for WINDOWSNT, use fdopen
for the the MSDOS version.
(read1): Avoid recording doc strings positions only for WINDOWSNT,
not for MSDOS.
parent 67d3b149
...@@ -475,8 +475,9 @@ Return t if file exists.") ...@@ -475,8 +475,9 @@ Return t if file exists.")
/* 1 means we are loading a compiled file. */ /* 1 means we are loading a compiled file. */
int compiled = 0; int compiled = 0;
Lisp_Object handler; Lisp_Object handler;
char *fmode = "r";
#ifdef DOS_NT #ifdef DOS_NT
char *dosmode = "rt"; fmode = "rt";
#endif /* DOS_NT */ #endif /* DOS_NT */
CHECK_STRING (file, 0); CHECK_STRING (file, 0);
...@@ -548,7 +549,7 @@ Return t if file exists.") ...@@ -548,7 +549,7 @@ Return t if file exists.")
compiled = 1; compiled = 1;
#ifdef DOS_NT #ifdef DOS_NT
dosmode = "rb"; fmode = "rb";
#endif /* DOS_NT */ #endif /* DOS_NT */
stat ((char *)XSTRING (found)->data, &s1); stat ((char *)XSTRING (found)->data, &s1);
XSTRING (found)->data[XSTRING (found)->size - 1] = 0; XSTRING (found)->data[XSTRING (found)->size - 1] = 0;
...@@ -577,12 +578,12 @@ Return t if file exists.") ...@@ -577,12 +578,12 @@ Return t if file exists.")
} }
} }
#ifdef DOS_NT #ifdef WINDOWSNT
close (fd); close (fd);
stream = fopen ((char *) XSTRING (found)->data, dosmode); stream = fopen ((char *) XSTRING (found)->data, fmode);
#else /* not DOS_NT */ #else /* not WINDOWSNT */
stream = fdopen (fd, "r"); stream = fdopen (fd, fmode);
#endif /* not DOS_NT */ #endif /* not WINDOWSNT */
if (stream == 0) if (stream == 0)
{ {
close (fd); close (fd);
...@@ -1581,7 +1582,7 @@ read1 (readcharfun, pch, first_in_list) ...@@ -1581,7 +1582,7 @@ read1 (readcharfun, pch, first_in_list)
if (c >= 0) if (c >= 0)
UNREAD (c); UNREAD (c);
#ifndef DOS_NT /* I don't know if filepos works right on MSDOS and Windoze. */ #ifndef WINDOWSNT /* I don't know if filepos works right on Windoze. */
if (load_force_doc_strings && EQ (readcharfun, Qget_file_char)) if (load_force_doc_strings && EQ (readcharfun, Qget_file_char))
{ {
/* If we are supposed to force doc strings into core right now, /* If we are supposed to force doc strings into core right now,
...@@ -1608,7 +1609,7 @@ read1 (readcharfun, pch, first_in_list) ...@@ -1608,7 +1609,7 @@ read1 (readcharfun, pch, first_in_list)
saved_doc_string_length = i; saved_doc_string_length = i;
} }
else else
#endif /* not DOS_NT */ #endif /* not WINDOWSNT */
{ {
/* Skip that many characters. */ /* Skip that many characters. */
for (i = 0; i < nskip && c >= 0; i++) for (i = 0; i < nskip && c >= 0; i++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment