diff options
| author | Eli Zaretskii | 2012-10-20 17:26:10 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-20 17:26:10 +0200 |
| commit | 83c85d8e2e6c1e1cb309f554555e1aebc1dcb44f (patch) | |
| tree | da7656122cac50b11b8efc31f8c3817306946b3a /lib-src/make-docfile.c | |
| parent | 71aa63da789e39ef49a2716fb977d2ea0e2d5f07 (diff) | |
| download | emacs-83c85d8e2e6c1e1cb309f554555e1aebc1dcb44f.tar.gz emacs-83c85d8e2e6c1e1cb309f554555e1aebc1dcb44f.zip | |
Fix last changes in make-docfile.c.
lib-src/make-docfile.c (IS_SLASH, DEF_ELISP_FILE): New macros.
(scan_lisp_file): Only pass a .el file if its basename matches a
known file in its entirety. Use IS_SLASH and DEF_ELISP_FILE.
Diffstat (limited to 'lib-src/make-docfile.c')
| -rw-r--r-- | lib-src/make-docfile.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 2f04f1c96f3..b6cd1530a4c 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -58,9 +58,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 58 | #undef chdir | 58 | #undef chdir |
| 59 | #define READ_TEXT "rt" | 59 | #define READ_TEXT "rt" |
| 60 | #define READ_BINARY "rb" | 60 | #define READ_BINARY "rb" |
| 61 | #define IS_SLASH(c) ((c) == '/' || (c) == '\\' || (c) == ':') | ||
| 61 | #else /* not DOS_NT */ | 62 | #else /* not DOS_NT */ |
| 62 | #define READ_TEXT "r" | 63 | #define READ_TEXT "r" |
| 63 | #define READ_BINARY "r" | 64 | #define READ_BINARY "r" |
| 65 | #define IS_SLASH(c) ((c) == '/') | ||
| 64 | #endif /* not DOS_NT */ | 66 | #endif /* not DOS_NT */ |
| 65 | 67 | ||
| 66 | static int scan_file (char *filename); | 68 | static int scan_file (char *filename); |
| @@ -1098,6 +1100,8 @@ search_lisp_doc_at_eol (FILE *infile) | |||
| 1098 | return 1; | 1100 | return 1; |
| 1099 | } | 1101 | } |
| 1100 | 1102 | ||
| 1103 | #define DEF_ELISP_FILE(fn) { #fn, sizeof(#fn) - 1 } | ||
| 1104 | |||
| 1101 | static int | 1105 | static int |
| 1102 | scan_lisp_file (const char *filename, const char *mode) | 1106 | scan_lisp_file (const char *filename, const char *mode) |
| 1103 | { | 1107 | { |
| @@ -1108,12 +1112,14 @@ scan_lisp_file (const char *filename, const char *mode) | |||
| 1108 | follow the conventions of the doc strings expected by this | 1112 | follow the conventions of the doc strings expected by this |
| 1109 | function. These conventions are automatically followed by the | 1113 | function. These conventions are automatically followed by the |
| 1110 | byte compiler when it produces the .elc files. */ | 1114 | byte compiler when it produces the .elc files. */ |
| 1111 | static const char *const uncompiled[] = | 1115 | static struct { |
| 1112 | { | 1116 | const char *fn; |
| 1113 | "loaddefs.el", | 1117 | size_t fl; |
| 1114 | "loadup.el", | 1118 | } const uncompiled[] = { |
| 1115 | "charprop.el" | 1119 | DEF_ELISP_FILE (loaddefs.el), |
| 1116 | }; | 1120 | DEF_ELISP_FILE (loadup.el), |
| 1121 | DEF_ELISP_FILE (charprop.el) | ||
| 1122 | }; | ||
| 1117 | int i, match; | 1123 | int i, match; |
| 1118 | size_t flen = strlen (filename); | 1124 | size_t flen = strlen (filename); |
| 1119 | 1125 | ||
| @@ -1124,9 +1130,10 @@ scan_lisp_file (const char *filename, const char *mode) | |||
| 1124 | for (i = 0, match = 0; i < sizeof (uncompiled) / sizeof (uncompiled[0]); | 1130 | for (i = 0, match = 0; i < sizeof (uncompiled) / sizeof (uncompiled[0]); |
| 1125 | i++) | 1131 | i++) |
| 1126 | { | 1132 | { |
| 1127 | if (strlen (uncompiled[i]) <= flen | 1133 | if (uncompiled[i].fl <= flen |
| 1128 | && !strcmp (filename + flen - strlen (uncompiled[i]), | 1134 | && !strcmp (filename + flen - uncompiled[i].fl, uncompiled[i].fn) |
| 1129 | uncompiled[i])) | 1135 | && (flen == uncompiled[i].fl |
| 1136 | || IS_SLASH (filename[flen - uncompiled[i].fl - 1]))) | ||
| 1130 | { | 1137 | { |
| 1131 | match = 1; | 1138 | match = 1; |
| 1132 | break; | 1139 | break; |