From caab6ac968d8b22d9b089543a3881cc2159ee6e7 Mon Sep 17 00:00:00 2001 From: implicitfield <114500360+implicitfield@users.noreply.github.com> Date: Fri, 30 Sep 2022 21:09:29 +0300 Subject: [PATCH] test: Print the correct operator on error --- Userland/Utilities/test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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;