diff options
author | Eli Zaretskii <[email protected]> | 2010-01-22 10:44:50 +0200 |
---|---|---|
committer | Eli Zaretskii <[email protected]> | 2010-01-22 10:44:50 +0200 |
commit | 74327f7a7c4f8fb1ea4bacd8147ac5b1169231c3 (patch) | |
tree | 9588561818d5ef0ce771f1fee0af1f43fcb31ec5 /src | |
parent | 3e8f7d9196c6c5ccac68bfe4c083e541fc9922e0 (diff) |
Fix bug #5303 in `load' on MS-Windows, whereby load-file would fail
for files like C:/the-file.el in root directory of any drive.
lread.c (Fload): Don't treat files without .elc extension as
byte-compiled if they are ``magic'', i.e. `openp' returned -2 for
them.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/lread.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bdbdd0b0da..2a3263588c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-01-22 Eli Zaretskii <[email protected]> + + * lread.c (Fload): Don't treat files without .elc extension as + byte-compiled if they are ``magic'', i.e. `openp' returned -2 for + them. (bug#5303) + 2010-01-20 Kenichi Handa <[email protected]> * coding.c (consume_chars): If ! multibyte and the encoder is ccl, diff --git a/src/lread.c b/src/lread.c index db425b8229..ba9d537810 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1155,7 +1155,7 @@ Return t if the file exists and loads successfully. */) if (!bcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4) - || (version = safe_to_load_p (fd)) > 0) + || (fd >= 0 && (version = safe_to_load_p (fd)) > 0)) /* Load .elc files directly, but not when they are remote and have no handler! */ { |