diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/lread.c b/src/lread.c index 70984d37e18..eabf3b938c2 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -979,9 +979,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) | |||
| 979 | 979 | ||
| 980 | /* Value is a version number of byte compiled code if the file | 980 | /* Value is a version number of byte compiled code if the file |
| 981 | associated with file descriptor FD is a compiled Lisp file that's | 981 | associated with file descriptor FD is a compiled Lisp file that's |
| 982 | safe to load. Only files compiled with Emacs are safe to load. | 982 | safe to load. Only files compiled with Emacs can be loaded. */ |
| 983 | Files compiled with XEmacs can lead to a crash in Fbyte_code | ||
| 984 | because of an incompatible change in the byte compiler. */ | ||
| 985 | 983 | ||
| 986 | static int | 984 | static int |
| 987 | safe_to_load_version (int fd) | 985 | safe_to_load_version (int fd) |
| @@ -1135,7 +1133,6 @@ Return t if the file exists and loads successfully. */) | |||
| 1135 | /* True means we are loading a compiled file. */ | 1133 | /* True means we are loading a compiled file. */ |
| 1136 | bool compiled = 0; | 1134 | bool compiled = 0; |
| 1137 | Lisp_Object handler; | 1135 | Lisp_Object handler; |
| 1138 | bool safe_p = 1; | ||
| 1139 | const char *fmode = "r" FOPEN_TEXT; | 1136 | const char *fmode = "r" FOPEN_TEXT; |
| 1140 | int version; | 1137 | int version; |
| 1141 | 1138 | ||
| @@ -1318,11 +1315,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1318 | if (version < 0 | 1315 | if (version < 0 |
| 1319 | && ! (version = safe_to_load_version (fd))) | 1316 | && ! (version = safe_to_load_version (fd))) |
| 1320 | { | 1317 | { |
| 1321 | safe_p = 0; | 1318 | error ("File `%s' was not compiled in Emacs", SDATA (found)); |
| 1322 | if (!load_dangerous_libraries) | ||
| 1323 | error ("File `%s' was not compiled in Emacs", SDATA (found)); | ||
| 1324 | else if (!NILP (nomessage) && !force_load_messages) | ||
| 1325 | message_with_string ("File `%s' not compiled in Emacs", found, 1); | ||
| 1326 | } | 1319 | } |
| 1327 | 1320 | ||
| 1328 | compiled = 1; | 1321 | compiled = 1; |
| @@ -1429,10 +1422,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1429 | 1422 | ||
| 1430 | if (NILP (nomessage) || force_load_messages) | 1423 | if (NILP (nomessage) || force_load_messages) |
| 1431 | { | 1424 | { |
| 1432 | if (!safe_p) | 1425 | if (is_module) |
| 1433 | message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...", | ||
| 1434 | file, 1); | ||
| 1435 | else if (is_module) | ||
| 1436 | message_with_string ("Loading %s (module)...", file, 1); | 1426 | message_with_string ("Loading %s (module)...", file, 1); |
| 1437 | else if (!compiled) | 1427 | else if (!compiled) |
| 1438 | message_with_string ("Loading %s (source)...", file, 1); | 1428 | message_with_string ("Loading %s (source)...", file, 1); |
| @@ -1492,10 +1482,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1492 | 1482 | ||
| 1493 | if (!noninteractive && (NILP (nomessage) || force_load_messages)) | 1483 | if (!noninteractive && (NILP (nomessage) || force_load_messages)) |
| 1494 | { | 1484 | { |
| 1495 | if (!safe_p) | 1485 | if (is_module) |
| 1496 | message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...done", | ||
| 1497 | file, 1); | ||
| 1498 | else if (is_module) | ||
| 1499 | message_with_string ("Loading %s (module)...done", file, 1); | 1486 | message_with_string ("Loading %s (module)...done", file, 1); |
| 1500 | else if (!compiled) | 1487 | else if (!compiled) |
| 1501 | message_with_string ("Loading %s (source)...done", file, 1); | 1488 | message_with_string ("Loading %s (source)...done", file, 1); |
| @@ -4975,7 +4962,7 @@ This overrides the value of the NOMESSAGE argument to `load'. */); | |||
| 4975 | When Emacs loads a compiled Lisp file, it reads the first 512 bytes | 4962 | When Emacs loads a compiled Lisp file, it reads the first 512 bytes |
| 4976 | from the file, and matches them against this regular expression. | 4963 | from the file, and matches them against this regular expression. |
| 4977 | When the regular expression matches, the file is considered to be safe | 4964 | When the regular expression matches, the file is considered to be safe |
| 4978 | to load. See also `load-dangerous-libraries'. */); | 4965 | to load. */); |
| 4979 | Vbytecomp_version_regexp | 4966 | Vbytecomp_version_regexp |
| 4980 | = build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); | 4967 | = build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); |
| 4981 | 4968 | ||