Skip to content

regina: RC is the port's numeric result, RESULT its string, for ARexx ports - #64

Open
jonx wants to merge 1 commit into
aros-development-team:masterfrom
jonx:fix/regina-arexx-rc
Open

jonx wants to merge 1 commit into
aros-development-team:masterfrom
jonx:fix/regina-arexx-rc

Conversation

@jonx

@jonx jonx commented Sep 18, 2026

Copy link
Copy Markdown

Problem

For a command sent to an ARexx port (ENVIR_AMIGA), envir.c passed retstr, the port's RESULT string, to post_process_system_call() as the value of RC. So a script that tests RC after a successful command that returns output sees a non-zero string and reads it as a failure, and RESULT is never set.

Fix

ARexx semantics: RC is the host's rm_Result1, and RESULT is its rm_Result2 string when OPTIONS RESULTS is on. For ARexx ports only, RC now gets the number and RESULT the string. Other environments keep their existing behaviour.

Testing

On hosted aarch64 AROS, with the static rexx built from these sources (the file list and defines of contrib-regina-rexx), driving a port that returns class codes in rm_Result1 and output in rm_Result2:

  • success: RC = 0, RESULT = the command's output;
  • eleven different refusals: RC = the exact numeric code each time;
  • the same sequence driven from an AmigaDOS script gives identical codes and output.

Before the fix, every successful command with output read as a failure.

🤖 Generated with Claude Code

… ports

For a command sent to an ARexx port (ENVIR_AMIGA), envir.c passed retstr,
the port's RESULT string, to post_process_system_call() as the value of RC.
A script testing RC after a successful command with output therefore saw a
non-zero string and read failure, and RESULT was never set.

ARexx semantics: RC is the host's rm_Result1, RESULT its rm_Result2 string
when OPTIONS RESULTS is on. Give RC the number and RESULT the string, for
ARexx ports only; other environments keep their existing behaviour.

Checked on hosted aarch64 AROS, with the static rexx built from these
sources, against a port that returns class codes in rm_Result1 and output
in rm_Result2: RC read 0 on success and the exact numeric code on each of
eleven refusal classes, with RESULT carrying the output.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant