diff options
| author | Eli Zaretskii | 1998-05-04 15:32:44 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1998-05-04 15:32:44 +0000 |
| commit | 229ba775d49f74c1144b583e1de6aef66f9fefdd (patch) | |
| tree | 52f6ab06d26661ab68c36d1efa190c188633a92c /src/lread.c | |
| parent | 67d3b149e2cdd55db5091fb0e3f9029cbf516819 (diff) | |
| download | emacs-229ba775d49f74c1144b583e1de6aef66f9fefdd.tar.gz emacs-229ba775d49f74c1144b583e1de6aef66f9fefdd.zip | |
(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.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lread.c b/src/lread.c index 1f4a8c5e093..755c6ec1d0a 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -475,8 +475,9 @@ Return t if file exists.") | |||
| 475 | /* 1 means we are loading a compiled file. */ | 475 | /* 1 means we are loading a compiled file. */ |
| 476 | int compiled = 0; | 476 | int compiled = 0; |
| 477 | Lisp_Object handler; | 477 | Lisp_Object handler; |
| 478 | char *fmode = "r"; | ||
| 478 | #ifdef DOS_NT | 479 | #ifdef DOS_NT |
| 479 | char *dosmode = "rt"; | 480 | fmode = "rt"; |
| 480 | #endif /* DOS_NT */ | 481 | #endif /* DOS_NT */ |
| 481 | 482 | ||
| 482 | CHECK_STRING (file, 0); | 483 | CHECK_STRING (file, 0); |
| @@ -548,7 +549,7 @@ Return t if file exists.") | |||
| 548 | compiled = 1; | 549 | compiled = 1; |
| 549 | 550 | ||
| 550 | #ifdef DOS_NT | 551 | #ifdef DOS_NT |
| 551 | dosmode = "rb"; | 552 | fmode = "rb"; |
| 552 | #endif /* DOS_NT */ | 553 | #endif /* DOS_NT */ |
| 553 | stat ((char *)XSTRING (found)->data, &s1); | 554 | stat ((char *)XSTRING (found)->data, &s1); |
| 554 | XSTRING (found)->data[XSTRING (found)->size - 1] = 0; | 555 | XSTRING (found)->data[XSTRING (found)->size - 1] = 0; |
| @@ -577,12 +578,12 @@ Return t if file exists.") | |||
| 577 | } | 578 | } |
| 578 | } | 579 | } |
| 579 | 580 | ||
| 580 | #ifdef DOS_NT | 581 | #ifdef WINDOWSNT |
| 581 | close (fd); | 582 | close (fd); |
| 582 | stream = fopen ((char *) XSTRING (found)->data, dosmode); | 583 | stream = fopen ((char *) XSTRING (found)->data, fmode); |
| 583 | #else /* not DOS_NT */ | 584 | #else /* not WINDOWSNT */ |
| 584 | stream = fdopen (fd, "r"); | 585 | stream = fdopen (fd, fmode); |
| 585 | #endif /* not DOS_NT */ | 586 | #endif /* not WINDOWSNT */ |
| 586 | if (stream == 0) | 587 | if (stream == 0) |
| 587 | { | 588 | { |
| 588 | close (fd); | 589 | close (fd); |
| @@ -1581,7 +1582,7 @@ read1 (readcharfun, pch, first_in_list) | |||
| 1581 | if (c >= 0) | 1582 | if (c >= 0) |
| 1582 | UNREAD (c); | 1583 | UNREAD (c); |
| 1583 | 1584 | ||
| 1584 | #ifndef DOS_NT /* I don't know if filepos works right on MSDOS and Windoze. */ | 1585 | #ifndef WINDOWSNT /* I don't know if filepos works right on Windoze. */ |
| 1585 | if (load_force_doc_strings && EQ (readcharfun, Qget_file_char)) | 1586 | if (load_force_doc_strings && EQ (readcharfun, Qget_file_char)) |
| 1586 | { | 1587 | { |
| 1587 | /* If we are supposed to force doc strings into core right now, | 1588 | /* If we are supposed to force doc strings into core right now, |
| @@ -1608,7 +1609,7 @@ read1 (readcharfun, pch, first_in_list) | |||
| 1608 | saved_doc_string_length = i; | 1609 | saved_doc_string_length = i; |
| 1609 | } | 1610 | } |
| 1610 | else | 1611 | else |
| 1611 | #endif /* not DOS_NT */ | 1612 | #endif /* not WINDOWSNT */ |
| 1612 | { | 1613 | { |
| 1613 | /* Skip that many characters. */ | 1614 | /* Skip that many characters. */ |
| 1614 | for (i = 0; i < nskip && c >= 0; i++) | 1615 | for (i = 0; i < nskip && c >= 0; i++) |