summaryrefslogtreecommitdiff
path: root/lisp/progmodes/sh-script.el
diff options
context:
space:
mode:
authorSam Steingold <sds@gnu.org>2001-10-26 13:54:45 +0000
committerSam Steingold <sds@gnu.org>2001-10-26 13:54:45 +0000
commit187cd25bb00b7d0a1cbd76556b7a87b1eca3039f (patch)
tree7fc7675a1693d4490bf7d2f74d6d4abb4fb01e62 /lisp/progmodes/sh-script.el
parent035107fa9cbb1b0b2f53b5a4623b9f4cbfc61544 (diff)
downloademacs-187cd25bb00b7d0a1cbd76556b7a87b1eca3039f.tar.gz
(sh-font-lock-close-heredoc): check the args for being non-nil
Diffstat (limited to 'lisp/progmodes/sh-script.el')
-rw-r--r--lisp/progmodes/sh-script.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 8c05826d7f4..a3b95231774 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -828,7 +828,7 @@ See `sh-feature'.")
(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 @@ be indented (i.e. a <<- was used rather than just <<)."
(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)))))