* makeint.h (STOP_SET): [SV 40371] Cast to unsigned char.
authorPaul Smith <psmith@gnu.org>
Sat, 26 Oct 2013 04:10:17 +0000 (00:10 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 27 Oct 2013 21:43:21 +0000 (17:43 -0400)
* tests/scripts/misc/utf8: Test variable names with characters >127.
Fix suggested by Robert Bogomip <bob.bogo@milohedge.com>

makeint.h
tests/scripts/misc/utf8 [new file with mode: 0644]

index 77f51e019b7b4b9eaf684bcb8baaf6400c13d35c..c591427ce0604fe401f8e6789b4f83d50dcd6cff 100644 (file)
--- a/makeint.h
+++ b/makeint.h
@@ -415,7 +415,7 @@ extern int unixy_shell;
 # define MAP_VMSCOMMA   0x0000
 #endif
 
-#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(int)(_v)],(_m))
+#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(unsigned char)(_v)],(_m))
 
 #if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
 # define SET_STACK_SIZE
diff --git a/tests/scripts/misc/utf8 b/tests/scripts/misc/utf8
new file mode 100644 (file)
index 0000000..2adcd07
--- /dev/null
@@ -0,0 +1,14 @@
+#                                                                    -*-perl-*-
+$description = "Test utf8 handling.";
+
+$details = "";
+
+# Variable names containing UTF8 characters
+run_make_test("
+\xe2\x96\xaa := hello
+\$(info \$(\xe2\x96\xaa))
+all:
+",
+              '', "hello\n#MAKE#: Nothing to be done for 'all'.");
+
+1;