summaryrefslogtreecommitdiff
path: root/lib-src/make-docfile.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-06-21 19:46:58 +0000
committerRichard M. Stallman <rms@gnu.org>1995-06-21 19:46:58 +0000
commitdc61cb9dd8c79d95f5020908b171c8482a17908a (patch)
tree8ad4bd979678025e3a81528ff3330e44de3bb086 /lib-src/make-docfile.c
parent5281dea44219384e830d49e7ac646ce93ccf4814 (diff)
(scan_file): Make sure it never looks at filename[-1].
Diffstat (limited to 'lib-src/make-docfile.c')
-rw-r--r--lib-src/make-docfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 948a725708..f647c21dea 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -177,9 +177,9 @@ scan_file (filename)
char *filename;
{
int len = strlen (filename);
- if (!strcmp (filename + len - 4, ".elc"))
+ if (len > 4 && !strcmp (filename + len - 4, ".elc"))
return scan_lisp_file (filename, READ_BINARY);
- else if (!strcmp (filename + len - 3, ".el"))
+ else if (len > 3 && !strcmp (filename + len - 3, ".el"))
return scan_lisp_file (filename, READ_TEXT);
else
return scan_c_file (filename, READ_TEXT);