aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/lread.c19
2 files changed, 21 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b0899d67ca8..601c72a9fd3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12012-09-28 Glenn Morris <rgm@gnu.org>
2
3 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4
12012-09-27 Paul Eggert <eggert@cs.ucla.edu> 52012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 Check more robustly for timer_settime. 7 Check more robustly for timer_settime.
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 {