about summary refs log tree commit diff
path: root/posix/tst-fnmatch.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2021-09-01 13:17:34 -0400
committerDJ Delorie <dj@redhat.com>2021-09-01 14:29:59 -0400
commit69623c0db0a540f26ee537bae09446d3dcdf1f80 (patch)
tree089930c955e3a1d8779d4e19100ea17420e3a42e /posix/tst-fnmatch.c
parent224edada607ebc6aaa1aadaae423128fae7880df (diff)
downloadglibc-69623c0db0a540f26ee537bae09446d3dcdf1f80.tar.gz
glibc-69623c0db0a540f26ee537bae09446d3dcdf1f80.tar.xz
glibc-69623c0db0a540f26ee537bae09446d3dcdf1f80.zip
posix: remove some iso-8859-encoded characters
With the increasing adoption of UTF-8, modern editors may (will?)
replace iso-8859-encoded characters in the range 0x80..0xff with
their UTF-8 equivalent, as will mailers and other tools.  This breaks
our testsuite and corrupts patches.

So, this patch starts replacing these problematic characters with
\OCTal sequences instead (adding support for those in tst-fnmatch.c)
or with plain ASCII characters (PTESTS).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'posix/tst-fnmatch.c')
-rw-r--r--posix/tst-fnmatch.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/posix/tst-fnmatch.c b/posix/tst-fnmatch.c
index 7e1b28832a..670a3c3c44 100644
--- a/posix/tst-fnmatch.c
+++ b/posix/tst-fnmatch.c
@@ -193,6 +193,19 @@ next_input (char **line, int first, int last)
 	      *wp++ = '\t';
 	    else if (*cp == 'n')
 	      *wp++ = '\n';
+	    else if (*cp >= '0' && *cp <= '7')
+	      {
+		int ndigits = 0;
+		int cval = 0;
+		while (ndigits < 3 && *cp >= '0' && *cp <= '7')
+		  {
+		    cval *= 8;
+		    cval += (*cp++) - '0';
+		    ndigits ++;
+		  }
+		*wp++ = cval;
+		--cp;
+	      }
 	    else
 	      *wp++ = *cp;