Allow #! as begin of filein chunk
authorStefan Vogel <sv@exept.de>
Wed, 08 May 2002 16:30:05 +0200
changeset 6538 1828dcb8f067
parent 6537 7906825ad5c3
child 6539 62e7528c83fe
Allow #! as begin of filein chunk
PositionableStream.st
--- a/PositionableStream.st	Tue May 07 18:57:28 2002 +0200
+++ b/PositionableStream.st	Wed May 08 16:30:05 2002 +0200
@@ -524,10 +524,21 @@
      dontAskSignals askSomeoneForPackage redef outerContext|
 
     self skipSeparators.
-    self peek == $< ifTrue:[
+    lastValue := self peek.
+    lastValue == $< ifTrue:[
         "/ assume, its an xml file
         ^ self fileInXMLNotifying:someone passChunk:passChunk.
     ].
+    lastValue == $# ifTrue:[
+        "assume unix interpreter name:
+         '#!!stx -e' or something like this"
+        self nextPeek == $!! ifTrue:[
+            "skip the unix command line"
+            self nextLine
+        ] ifFalse:[
+             self error:'Invalid chunk start'
+        ]
+    ].
 
     "/ support for V'Age applications
     defaultApplicationQuerySignal := Class defaultApplicationQuerySignal.
@@ -1098,6 +1109,6 @@
 !PositionableStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.110 2002-04-11 09:26:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.111 2002-05-08 14:30:05 stefan Exp $'
 ! !
 PositionableStream initialize!