Avoid recursion on string.replace()
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 27 Apr 2010 16:57:38 +0000 (16:57 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 27 Apr 2010 16:57:38 +0000 (16:57 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3553 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index 6afc8db2222907c39fe3d4ecb3fe3cf4fc2193d5..7c05a17c244f9cc959cb16072a0706ae38aae71b 100644 (file)
@@ -149,9 +149,7 @@ def userMkGeneratorFromPreset(project_info):
     destination = os.path.join(project_info.prjdir, "%s_user.mk" %project_info.info("PROJECT_NAME"))
     # Temporary code.
     # TODO: write it using regular expressions to secure this function
-    if preset_name != project_name:
-        while makefile.find(preset_name + "_") != -1:
-            makefile = makefile.replace(preset_name + "_", project_name + "_")
+    makefile = makefile.replace(preset_name + "_", project_name + "_")
     open(destination, "w").write(makefile)
 
 def userMkGenerator(project_info):