diff lisp/progmodes/sh-script.el @ 40336:8f116e4bd2cd

(sh-font-lock-close-heredoc): check the args for being non-nil
author Sam Steingold <sds@gnu.org>
date Fri, 26 Oct 2001 13:54:45 +0000
parents 96186171af6d
children 5800d6cc4718
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Fri Oct 26 13:48:53 2001 +0000
+++ b/lisp/progmodes/sh-script.el	Fri Oct 26 13:54:45 2001 +0000
@@ -828,7 +828,7 @@
 (defun sh-font-lock-close-heredoc (bol eof indented)
   "Determine the syntax of the \\n after an EOF.
 If non-nil INDENTED indicates that the EOF was indented."
-  (let* ((eof-re (regexp-quote eof))
+  (let* ((eof-re (if eof (regexp-quote eof) ""))
          ;; A rough regexp that should find the opening <<EOF back.
 	 (sre (concat "<<\\(-?\\)\\s-*['\"\\]?"
 		      ;; Use \s| to cheaply check it's an open-heredoc.
@@ -921,7 +921,8 @@
 	 (match-beginning 0) (match-string 1)) nil t)
      (5 (sh-font-lock-close-heredoc
 	 (match-beginning 0) (match-string 4)
-         (/= (match-beginning 3) (match-end 3))) nil t))
+         (and (match-beginning 3) (/= (match-beginning 3) (match-end 3))))
+      nil t))
     ;; Distinguish the special close-paren in `case'.
     (")" 0 (sh-font-lock-paren (match-beginning 0)))))