Ticket #27310: reinplace-backslash-patch.diff
File reinplace-backslash-patch.diff, 1.1 KB (added by JamesC1, 14 years ago) |
---|
-
src/port1.0/portutil.tcl
old new 858 858 proc reinplace {args} { 859 859 860 860 set extended 0 861 set unbackslash 0 862 861 863 while 1 { 862 864 set arg [lindex $args 0] 863 865 if {[string index $arg 0] eq "-"} { … … 866 868 E { 867 869 set extended 1 868 870 } 871 u { 872 set unbackslash 1 873 } 869 874 - { 870 875 break 871 876 } … … 878 883 } 879 884 } 880 885 if {[llength $args] < 2} { 881 error "reinplace ?- E? pattern file ..."886 error "reinplace ?-u? ?-E? pattern file ..." 882 887 } 883 888 set pattern [lindex $args 0] 884 889 set files [lrange $args 1 end] 885 890 891 if {$unbackslash} { 892 set pattern \ 893 [string map [list "\1" {\1} "\2" {\2} "\3" {\3} "\4" {\4} \ 894 "\5" {\5} "\6" {\6} "\7" {\7} ] $pattern ] 895 } 896 886 897 foreach file $files { 887 898 if {[catch {set tmpfile [mkstemp "/tmp/[file tail $file].sed.XXXXXXXX"]} error]} { 888 899 global errorInfo