|
Posted by comp.lang.tcl on 04/21/06 20:45
Bryan Oakley wrote:
> Bryan Oakley wrote:
>
> > Maybe you should file a bug with whomever wrote PROPER_CASE instead of
> > trying to work around its limitations.
> >
>
> FWIW, the culprit is this infinite loop:
>
> while {![regexp -nocase {[a-z]} [string index $wordlet $beginIndx]]} {
> append nonWord [string index $wordlet $beginIndx]
> incr beginIndx
> }
WOW! I would never have found that one, you are truly one of the TCL
gurus out there (you came highly recommended by those I know)
this seemed to have fixed the problem (probably overkill but it was the
best I could think up at the moment:
while {[info exists wordlet] && [string length $wordlet] > 0 &&
![regexp -nocase {[a-z]} [string index $wordlet $beginIndx]]} {
append nonWord [string index $wordlet $beginIndx]
incr beginIndx
}
Phil
>
> Under the right conditions (such as a word beginning or ending with "-"
> or "_"), $wordlet will be null. When wordlet is null, [string index
> $wordlet $beginIndx] will be null for all values of $beginIndx, the
> regexp will never match, and the loop will never terminate.
>
> --
> Bryan Oakley
> http://www.tclscripting.com
Navigation:
[Reply to this message]
|