From c25d86c6c70b50e9d55713ed7a63f61425fa0384 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 8 Aug 2024 15:57:14 -0500 Subject: [PATCH] support/gen-debug-trace-error-codes.sh: tweak for compatibility with mawk. --- support/gen-debug-trace-error-codes.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/support/gen-debug-trace-error-codes.sh b/support/gen-debug-trace-error-codes.sh index 1aba489d9..01f32faa8 100755 --- a/support/gen-debug-trace-error-codes.sh +++ b/support/gen-debug-trace-error-codes.sh @@ -12,7 +12,12 @@ BEGIN { print("#undef WOLFSSL_DEBUG_TRACE_ERROR_CODES_H") >> "wolfssl/debug-untrace-error-codes.h"; } { - if (match($0, "^[[:space:]]+([A-Z][A-Z0-9_]+)[[:space:]]*=[[:space:]]*(-[0-9]+)[,[:space:]]", errcode_a)) { + if (match($0, "^[[:space:]]+([A-Z][A-Z0-9_]+)[[:space:]]*=[[:space:]]*(-[0-9]+)[,[:space:]]")) { + + # for mawkward compatibility -- gawk allows errcode_a as the 3rd arg to match(). + gsub("^[[:space:]]+", "", $0); + split($0, errcode_a, "[[:space:]=,]+"); + if ((errcode_a[1] == "MIN_CODE_E") || (errcode_a[1] == "WC_LAST_E") || (errcode_a[1] == "MAX_CODE_E"))