summaryrefslogtreecommitdiff
path: root/Userland/Utilities/test.cpp
diff options
context:
space:
mode:
authorimplicitfield <114500360+implicitfield@users.noreply.github.com>2022-09-30 21:09:29 +0300
committerAndreas Kling <kling@serenityos.org>2022-10-02 21:33:01 +0200
commitcaab6ac968d8b22d9b089543a3881cc2159ee6e7 (patch)
treecfaadec8b675cb8435c233cef4d16e7b7ad10134 /Userland/Utilities/test.cpp
parent7760c007140f8acbd6f214898a7c8e7a565f4875 (diff)
downloadserenity-caab6ac968d8b22d9b089543a3881cc2159ee6e7.zip
test: Print the correct operator on error
Diffstat (limited to 'Userland/Utilities/test.cpp')
-rw-r--r--Userland/Utilities/test.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Utilities/test.cpp b/Userland/Utilities/test.cpp
index c05a27d6de..6a471dae6b 100644
--- a/Userland/Utilities/test.cpp
+++ b/Userland/Utilities/test.cpp
@@ -390,7 +390,9 @@ static OwnPtr<Condition> parse_simple_expression(char* argv[])
case 'N':
case 'O':
case 's':
- fatal_error("Unsupported operator \033[1m%s", argv[optind]);
+ // 'optind' has been incremented to refer to the argument after the
+ // operator, while we want to print the operator itself.
+ fatal_error("Unsupported operator \033[1m%s", argv[optind - 1]);
default:
--optind;
break;