diff --git a/tren.py b/tren.py index 3dadd54..6cfa514 100755 --- a/tren.py +++ b/tren.py @@ -9,7 +9,7 @@ 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 @@ -1079,20 +1079,22 @@ 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