--- tests/io.test	2003-07-21 19:47:15.000000000 -0600
+++ tests/io.test.fixed	2003-07-21 20:16:35.000000000 -0600
@@ -1579,6 +1579,10 @@
 } {line line none}
 
 set path(test3) [makeFile {} test3]
+# Test paths may contain characters which have special meaning to
+# the regexp engine (see SF bug #775394)
+set map {{[} {\[} \] {\]} ( {\(} ) {\)} + {\+} ? {\?} * {\*} \{ {\{} 
+    \} {\}} ^ {\^} {$} {\$} \\ {\\}}
 
 test io-14.3 {Tcl_SetStdChannel & Tcl_GetStdChannel} {exec} {
     set f [open $path(test1) w]
@@ -5224,7 +5228,7 @@
     close $f
     set msg [list [catch {open $path(test3) {WRONLY CREAT EXCL}} msg] $msg]
     regsub " already " $msg " " msg
-    regsub [file join {} $path(test3)] $msg "test3" msg
+    regsub [string map $map [file join {} $path(test3)]] $msg "test3" msg
     string tolower $msg
 } {1 {couldn't open "test3": file exists}}
 test io-40.7 {POSIX open access modes: EXCL} {
@@ -5273,13 +5277,13 @@
 test io-40.11 {POSIX open access modes: RDONLY} {
     removeFile test3
     set msg [list [catch {open $path(test3) RDONLY} msg] $msg]
-    regsub [file join {} $path(test3)] $msg "test3" msg
+    regsub [string map $map [file join {} $path(test3)]] $msg "test3" msg
 	string tolower $msg
 } {1 {couldn't open "test3": no such file or directory}}
 test io-40.12 {POSIX open access modes: WRONLY} {
     removeFile test3
     set msg [list [catch {open $path(test3) WRONLY} msg] $msg]
-    regsub [file join {} $path(test3)] $msg "test3" msg
+    regsub [string map $map [file join {} $path(test3)]] $msg "test3" msg
 	string tolower $msg
 } {1 {couldn't open "test3": no such file or directory}}
 test io-40.13 {POSIX open access modes: WRONLY} {
@@ -5297,7 +5301,7 @@
 test io-40.14 {POSIX open access modes: RDWR} {
     removeFile test3
     set msg [list [catch {open $path(test3) RDWR} msg] $msg]
-    regsub [file join {} $path(test3)] $msg "test3" msg
+    regsub [string map $map [file join {} $path(test3)]] $msg "test3" msg
 	string tolower $msg
 } {1 {couldn't open "test3": no such file or directory}}
 test io-40.15 {POSIX open access modes: RDWR} {
