Mail Archives: djgpp/1996/12/10/17:57:08
On Thu, 5 Dec 1996, John Schucker wrote:
> q foo
> (in editor type)
> echo foo
> (save this)
> And then from 'bash$' type
> foo
> My computer locks with exception 6. This happens every single time I do
> this. I am using qemm 7.5, but since I am not using its DPMI server, I
> really don't see how it would affect anything. Help?
I don't think this is a bug, you just force `bash' to do the impossible:
execute an arbitrary text file as a shell script. The fact that the file
includes valid shell commands is irrelevant, because `bash' doesn't know
that (it doesn't read the entire file). To make the above script look
like a script, you should put the following on the first line:
#!/bin/bash
Then two things will automagically happen: (1) a call to `stat' will
return an execute bit set for this file (might be important to `bash',
since it probably requires scripts to be executable); and (2) `bash' will
either call `spawn' to run the script or read and execute it itself, both
of which will succeed (I didn't look into `bash' sources to determine
which of these two alternatives actually gets executed).
The way you did it, `bash' just tried to call DOS to run the script, and
DOS thinks that any file which isn't a .exe is a .com image, so it tries
to load and execute it, with obvious consequences...
> At the risk of having babbled enough already, I tried doing a make of
> less. It makes fine, but for some reason, I can't get it to use BIOS
> writes as opposed to direct video. I tried setting directvideo = 0; in
> both screen.c and main.c I know conio.h said gppconio ignores the value
> of directvideo, but I thought that was for stuff in the gppconio.h file?
Both conio and gppconio are the same, they don't support BIOS writes.
That's why the speech-friendly option of Info uses DOS I/O.
> I also tried replacing all occurrences of cputs(foo); in screen.c with:
> fputs(foo,stdout);
> but when I do a make and then do less --help or less less.man, it still
> uses direct video writes.
I don't see how this can be possible, this replacement should have done
the trick. Please post all the places where you replaced cputs -> fputs,
and also tell whether direct writes are used (after the replacement) in
all screen writes or just in some of them.
- Raw text -