aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c
index cb808b37677..0b7fd9067dc 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -764,13 +764,28 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
764 764
765/* Return true if the lisp code read using READCHARFUN defines a non-nil 765/* Return true if the lisp code read using READCHARFUN defines a non-nil
766 `lexical-binding' file variable. After returning, the stream is 766 `lexical-binding' file variable. After returning, the stream is
767 positioned following the first line, if it is a comment, otherwise 767 positioned following the first line, if it is a comment or #! line,
768 nothing is read. */ 768 otherwise nothing is read. */
769 769
770static int 770static int
771lisp_file_lexically_bound_p (Lisp_Object readcharfun) 771lisp_file_lexically_bound_p (Lisp_Object readcharfun)
772{ 772{
773 int ch = READCHAR; 773 int ch = READCHAR;
774
775 if (ch == '#')
776 {
777 ch = READCHAR;
778 if (ch != '!')
779 {
780 UNREAD (ch);
781 UNREAD ('#');
782 return 0;
783 }
784 while (ch != '\n' && ch != EOF)
785 ch = READCHAR;
786 if (ch == '\n') ch = READCHAR;
787 }
788
774 if (ch != ';') 789 if (ch != ';')
775 /* The first line isn't a comment, just give up. */ 790 /* The first line isn't a comment, just give up. */
776 { 791 {