Most other cases, TS writes an error string to strbuf.
For (quit 1) it does not.
On many OS, a non-zero error code from a program means an error.
You could argue that it is the responsibility of the OS to fabricate an error message,
and not the responsibility of TinyScheme.
See more discussion at gimp #9554.
The GIMP fork of this repo did change in this regard, something like this:
case OP_QUIT: /* quit */
if(is_pair(sc->args)) {
sc->retcode=ivalue(car(sc->args));
gint err_code = ivalue(car(sc->args));
sc->retcode = err_code;
/* ScriptFu specific.
* Non-zero code means script as PDB procedure declares failure.
* Invariant that a SF fail puts message to output port.
*
* FIXME: to avoid diverging from TinyScheme, ask upstream for QUIT_HOOK.
* OR make script_fu_interpret_string ensure non-empty error message.
*/
if (err_code != 0)
{
snprintf(sc->strbuff, STRBUFFSIZE, "script quit with code: %d", err_code);
putstr (sc, sc->strbuff);
}
}
return (sc->NIL);