« Return to Thread: Possible bug detected in js shell 1.8.5 for linux.

Re: Possible bug detected in js shell 1.8.5 for linux.

by Triston Taylor :: Rate this Message:

| View in Thread

On Monday, March 26, 2012 10:08:34 PM UTC-5, Triston Taylor wrote:
> On Monday, March 26, 2012 10:06:04 PM UTC-5, Triston Taylor wrote:
> > I think it might have something to do with the ShellHack code. I'm not sure but I don't think you can call ungetc on a pipe. It goes beyond the purpose of a FIFO stack.
>
> Maybe (if that is the case) the ShellHack should read the entire file and then compile the text from a pointer past the #!....\n|\r at the start of the script instead of trying to compile the file handle.

On Monday, March 26, 2012 10:08:34 PM UTC-5, Triston Taylor wrote:
> On Monday, March 26, 2012 10:06:04 PM UTC-5, Triston Taylor wrote:
> > I think it might have something to do with the ShellHack code. I'm not sure but I don't think you can call ungetc on a pipe. It goes beyond the purpose of a FIFO stack.
>
> Maybe (if that is the case) the ShellHack should read the entire file and then compile the text from a pointer past the #!....\n|\r at the start of the script instead of trying to compile the file handle.

I propose better conformance to the unix shebang standard:

// allocate some memory for file data as SourcePtr
// read the file in to SourcePtr

IF charsAt(SourcePtr, 2) == '#!' then SourcePtr = getEndOfLinePtr(SourcePtr) + 1 // remain compatible with sharp variables.

compile(SourcePtr)

// free the Source Memory

Sorry, I'm not a c programmer yet, so reference, guessing and pseudo code is best I can do. The second arg to psuedo function charsAt is length.
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

 « Return to Thread: Possible bug detected in js shell 1.8.5 for linux.