Cleanup: avoid temp string edit

This commit is contained in:
Campbell Barton 2016-06-04 10:51:34 +10:00
parent 38410e6e25
commit 17fbce9549
Notes: blender-bot 2023-02-14 08:33:26 +01:00
Referenced by issue #48587, Color Mix "Add" mode is broken in Cycles
1 changed files with 2 additions and 6 deletions

View File

@ -730,14 +730,10 @@ static char *rna_path_rename_fix(ID *owner_id, const char *prefix, const char *o
DynStr *ds = BLI_dynstr_new();
const char *postfixPtr = oldNamePtr + oldNameLen;
char *newPath = NULL;
char oldChar;
/* add the part of the string that goes up to the start of the prefix */
if (prefixPtr > oldpath) {
oldChar = prefixPtr[0];
prefixPtr[0] = 0;
BLI_dynstr_append(ds, oldpath);
prefixPtr[0] = oldChar;
BLI_dynstr_nappend(ds, oldpath, prefixPtr - oldpath);
}
/* add the prefix */