Skip to content

Commit caab6ac

Browse files
implicitfieldawesomekling
authored andcommitted
test: Print the correct operator on error
1 parent 7760c00 commit caab6ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Userland/Utilities/test.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ static OwnPtr<Condition> parse_simple_expression(char* argv[])
390390
case 'N':
391391
case 'O':
392392
case 's':
393-
fatal_error("Unsupported operator \033[1m%s", argv[optind]);
393+
// 'optind' has been incremented to refer to the argument after the
394+
// operator, while we want to print the operator itself.
395+
fatal_error("Unsupported operator \033[1m%s", argv[optind - 1]);
394396
default:
395397
--optind;
396398
break;

0 commit comments

Comments
 (0)