Changeset 1036


Ignore:
Timestamp:
09/11/09 18:08:35 (2 years ago)
Author:
james
Message:

fixed logic error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/en/output_VAR.tcl

    r1032 r1036  
    122122                                        bMotion_putloglev 1 * "pluralising $replacement" 
    123123                                        set replacement [bMotionMakePlural $replacement] 
     124                                        putlog $replacement 
    124125                                } 
    125126                                "owner" { 
     
    133134                                } 
    134135                        } 
    135  
    136                         # actually do the replacement 
    137                         regsub $whole_thing $line $replacement line 
     136                        bMotion_putloglev 1 * "current replacement is $replacement" 
    138137                } 
    139138 
    140                 if {[llength $options_list] == 0} { 
    141                         regsub $whole_thing $line $replacement line 
     139                set location [string first $whole_thing $line] 
     140                if {$location == -1} { 
     141                        # something's broken 
     142                        putlog "bMotion: error parsing $whole_thing in $line, unable to insert $replacement" 
     143                        return "" 
    142144                } 
     145                set line [string replace $line $location [expr $location + [string length $matches] - 1] $replacement] 
    143146 
    144147                # check if what we swapped in gave us a %noun 
Note: See TracChangeset for help on using the changeset viewer.