Skip to content

quit-return does not impact return code of red binary #4095

@iNode

Description

@iNode

Chat discussion reference
https://gitter.im/red/bugs?at=5dab1054714b8b05381f40a1

Bug description
It seems like red binary executes console for actual code evaluation but does not handle console's exit code properly, as result quit and quit-return calls do not affect actual return code of red binary.

At the moment red implementation always returns 0:

red/red.r

Line 510 in 15b1300

quit/return 0

To reproduce
Steps to reproduce the behaviour:

$ cat exit1.red
Red [Title: "Test quit-return" ]
quit-return 1
$ red exit1.red; echo $?
0
# expected return code is 1, but it's always 0

Expected behavior

Red binary return code corresponds to argument of quit-return or quit instead of hardcoded value.

Platform version (please complete the following information)

Red 0.6.4 for Linux built 19-Oct-2019/13:57:16+03:00 commit #15b1300

Metadata

Metadata

Assignees

Labels

status.wontfixChange requested by ticket will not be done (should be elaborated in comments).type.reviewTicket describes a possible improvement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions