changeset 12351:f2e9eb6a8939

(scan_file): Make sure it never looks at filename[-1].
author Richard M. Stallman <rms@gnu.org>
date Wed, 21 Jun 1995 19:46:58 +0000
parents 68508136431f
children e6b42a6ea8e6
files lib-src/make-docfile.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/make-docfile.c	Wed Jun 21 19:45:27 1995 +0000
+++ b/lib-src/make-docfile.c	Wed Jun 21 19:46:58 1995 +0000
@@ -177,9 +177,9 @@
      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);