Skip to content

Commit

Permalink
Use g_build_filename() instead of g_strconcat().
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed May 21, 2008
1 parent 0be6f79 commit 9cbd3ca
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/utilops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2065,12 +2065,16 @@ static void file_util_rename_multiple_auto(RenameDataMult *rd)
gchar *new_name;

new_name = file_util_rename_multiple_auto_format_name(format, fd->name, n);
dest = g_strconcat(base, "/", new_name, NULL);
dest = g_build_filename(base, new_name, NULL);
g_free(new_name);
}
else
{
dest = g_strdup_printf("%s/%s%0*d%s", base, front, padding, n, end);
gchar *new_name;

new_name = g_strdup_printf("%s%0*d%s", front, padding, n, end);
dest = g_build_filename(base, new_name, NULL);
g_free(new_name);
}

if (isname(dest)) success = FALSE;
Expand Down Expand Up @@ -2117,12 +2121,16 @@ static void file_util_rename_multiple_auto(RenameDataMult *rd)
gchar *new_name;

new_name = file_util_rename_multiple_auto_format_name(format, fd->name, n);
dest = g_strconcat(base, "/", new_name, NULL);
dest = g_build_filename(base, new_name, NULL);
g_free(new_name);
}
else
{
dest = g_strdup_printf("%s/%s%0*d%s", base, front, padding, n, end);
gchar *new_name;

new_name = g_strdup_printf("%s%0*d%s", front, padding, n, end);
dest = g_build_filename(base, new_name, NULL);
g_free(new_name);
}

if (!file_data_add_change_info(fd, FILEDATA_CHANGE_RENAME, fd->path, dest) ||
Expand Down

0 comments on commit 9cbd3ca

Please sign in to comment.