FYI, a bug report seems to have cropped up in the actual Frotz core code. Here's the link:
Here's what it says.
This is for all of you Frotz porters. A couple
days I was informed of a bug in Frotz's core code by David Fillmore.
This seems to be the best place to get in touch with you.
According to the Z-Machine specification:
"In
Version 6, a width field may optionally be given: if this is non-zero,
text will then be justified as if it were in the window with that number
(if width is positive) or a box -width pixels wide (if negative). Then
the table will contain not ordinary text but formatted text: see
print_form."
Frotz, on the other hand, tries to get the width of a
window of number -width if the value is <= 0, but passes the width
value through directly if it is positive. This results in the
interpreter crashing with an "Illegal window" error if the width value
is less than -7.
Sample Inform6 code tickling this bug:
Code:
Switches v6;
Array formatted table 50;
[ main x;
@output_stream 3 formatted (-30); ! Frotz treats this as a window number and crashes.
print "ooh, hello there^boy^how are you";
@output_stream (-3);
@print_form formatted;
@read_char 1 -> x;
];
The culprit is in redirect.c in the memory_open() function. The offending code reads thus:
Code:
if (buffering && (short) xsize <= 0)
xsize = get_max_width ((zword) (- (short) xsize));
The fix is to replace those two lines with this:
Code:
else {
if ((short) xsize >= 0)
xsize = get_max_width (xsize);
else
xsize = -xsize;
}
Complete details are available at
https://github.com/DavidGriffith/frotz/issues/1