From f16557b5a03c04972b0b35eef114e92d2195e529 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Mar 2016 13:15:21 +0000 Subject: Alternative solution for [f1253530cd] --- library/word.tcl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/library/word.tcl b/library/word.tcl index b8f34a5..3e4bc3a 100644 --- a/library/word.tcl +++ b/library/word.tcl @@ -15,12 +15,20 @@ if {$::tcl_platform(platform) eq "windows"} { # Windows style - any but a unicode space char - set ::tcl_wordchars {\S} - set ::tcl_nonwordchars {\s} + if {![info exists ::tcl_wordchars]} { + set ::tcl_wordchars {\S} + } + if {![info exists ::tcl_nonwordchars]} { + set ::tcl_nonwordchars {\s} + } } else { # Motif style - any unicode word char (number, letter, or underscore) - set ::tcl_wordchars {\w} - set ::tcl_nonwordchars {\W} + if {![info exists ::tcl_wordchars]} { + set ::tcl_wordchars {\w} + } + if {![info exists ::tcl_nonwordchars]} { + set ::tcl_nonwordchars {\W} + } } # Arrange for caches of the real matcher REs to be kept, which enables the REs -- cgit v0.12