Fixed bug in case-insensitive replacement introduced by last checkin.
1 parent fd5f899 commit 992ae378b5105b5d2606692ea8f90aadcae7e614
@tundra tundra authored on 29 Aug 2010
Showing 1 changed file
View
12
tren.py
PROGNAME = "tren.py"
BASENAME = PROGNAME.split(".py")[0]
PROGENV = BASENAME.upper()
INCLENV = PROGENV + "INCL"
RCSID = "$Id: tren.py,v 1.236 2010/08/30 01:52:23 tundra Exp $"
RCSID = "$Id: tren.py,v 1.237 2010/08/30 02:06:42 tundra Exp $"
VERSION = RCSID.split()[2]
 
# Copyright Information
 
# Handle literal string replacement
 
else:
 
searchtarget = newname
# Collapse case if requested
 
if not renrequest[CASESENSITIVE]:
 
newname = newname.lower()
searchtarget = searchtarget.lower()
old = old.lower()
 
oldlen = len(old)
i = newname.find(old)
i = searchtarget.find(old)
while i >= 0:
 
nextloc = i + oldlen
oldstrings.append((i, nextloc))
i = newname.find(old, nextloc)
i = searchtarget.find(old, nextloc)
 
# If we found any matching strings, replace them
 
if oldstrings: