add a testcase for reopened bug 585 (not fixed yet)
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 16 Sep 2009 12:04:07 +0000 (14:04 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 16 Sep 2009 12:04:07 +0000 (14:04 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash_test/ash-redir/redir7.tests
shell/ash_test/ash-redir/redir8.right [new file with mode: 0644]
shell/ash_test/ash-redir/redir8.tests [new file with mode: 0755]

index e9bedd0f4e6cf390cb4b8471ac359bcfe08dfcde..17d1040e03499f4000bb36597901007b80cdb175 100755 (executable)
@@ -2,7 +2,9 @@
 # 0x81 is CTLESC (see ash.c).
 # The bug was that quoting and unquoting of them
 # was out of sync for redirect filenames.
-echo -e 'echo Ok >uni\x81code' >unicode.sh
+
+>unicode.sh
+echo -e 'echo Ok >uni\x81code' >>unicode.sh
 echo -e 'cat uni\x81code' >>unicode.sh
 echo -e 'cat uni?code' >>unicode.sh
 . unicode.sh
diff --git a/shell/ash_test/ash-redir/redir8.right b/shell/ash_test/ash-redir/redir8.right
new file mode 100644 (file)
index 0000000..6430b02
--- /dev/null
@@ -0,0 +1,3 @@
+Ok
+Ok
+Done
diff --git a/shell/ash_test/ash-redir/redir8.tests b/shell/ash_test/ash-redir/redir8.tests
new file mode 100755 (executable)
index 0000000..32ab607
--- /dev/null
@@ -0,0 +1,15 @@
+# Chars above 0x7f are used as special codes.
+# 0x81 is CTLESC (see ash.c).
+# The bug was that quoting and unquoting of them
+# was out of sync for redirect filenames.
+
+# Subcase when redirect filename is specified in a variable.
+
+>unicode.sh
+echo -e 'v=uni\x81code' >>unicode.sh
+echo -e 'echo Ok >"$v"' >>unicode.sh
+echo -e 'cat uni\x81code' >>unicode.sh
+echo -e 'cat uni?code' >>unicode.sh
+. unicode.sh
+rm uni*code*
+echo Done