[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
reading "#!"
From: |
Pascal Bourguignon |
Subject: |
reading "#!" |
Date: |
02 Jun 2003 07:32:20 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
$ emacs --version
GNU Emacs 21.3.50.1
Copyright (C) 2002 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
$ emacs --no-init-file --no-site-file --batch \
--eval '(read-from-string "#!/bin/bash")'
loops indefinitely, or at least, more than I care to wait for it. (Not
specific to --batch).
The bug seems to be in read1 (lread.c) arround:
if (c == '!')
{
/* #! appears at the beginning of an executable file.
Skip the first line. */
while (c != '\n')
c = READCHAR;
goto retry;
}
That's not because we have a "#!' that it's followed by '\n'!
Make it:
while((c != '\n')&&(c>'\0')){
c = READCHAR;
}
I don't see any comment arround the readchar header specifying its
contract:
static int
readchar (readcharfun)
Lisp_Object readcharfun;
{
but it seems that it may return -1 in some cases too...
--
__Pascal_Bourguignon__ http://www.informatimago.com/
----------------------------------------------------------------------
Do not adjust your mind, there is a fault in reality.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- reading "#!",
Pascal Bourguignon <=