git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] test-lib.sh/test_decode_color(): use octal not hex in awk script

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Dec 22, 2010, 23:58 UTC
Message-ID
<jpN7nm-rtl4sNXi5qt9pXMHyBTgpDCv8-V01kCtiJEBPqOcDSM23hxN4tPbRHKxs9OccFdSHwdWDxm1VEOf_Ag@cipher.nrlssc.navy.mil>
In-Reply-To
<jpN7nm-rtl4sNXi5qt9pXMafcDOI0AxF95o77x_r5JQwZeaH94BApUuIwonUaYfzmYTgqeFNpSm6S7VFnIZVag@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>
POSIX awk seems to explicitly not support hexadecimal escape sequences.
>From http://pubs.opengroup.org/onlinepubs/009695399/:
   Regular expressions in awk have been extended somewhat...
   One sequence that is not supported is hexadecimal value escapes
   beginning with '\x'.

This affects the awk on IRIX 6.5, and causes t4015.56 to fail. Use octal instead.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/test-lib.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 48fa516..cb1ca97 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -260,7 +260,7 @@ test_decode_color () {
 			if (n == 47) return "BWHITE";
 		}
 		{
-			while (match($0, /\x1b\[[0-9;]*m/) != 0) {
+			while (match($0, /\033\[[0-9;]*m/) != 0) {
 				printf "%s<", substr($0, 1, RSTART-1);
 				codes = substr($0, RSTART+2, RLENGTH-3);
 				if (length(codes) == 0)
-- 
1.7.3.1
Previous: Brandon CaseyNext: Brandon Casey
Message 2 of 7 in “Makefile: add NO_FNMATCH_CASEFOLD to IRIX sections”
  1. 1/3 Makefile: add NO_FNMATCH_CASEFOLD to IRIX sectionsBrandon Casey, Dec 22, 2010
  2. 2/3 test-lib.sh/test_decode_color(): use octal not hex in awk scriptBrandon Casey, Dec 22, 2010
  3. 3/3 t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'Brandon Casey, Dec 22, 2010
  4. Junio C HamanoDec 23, 2010
  5. Brandon CaseyDec 23, 2010
  6. Junio C HamanoDec 23, 2010
  7. Brandon CaseyDec 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.