(vfs_s_normalize_filename_leading_spaces): minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2015-01-16 10:36:08 +03:00
parent 21376ec1e9
commit a5826c3f6e

View File

@ -1714,14 +1714,15 @@ vfs_s_normalize_filename_leading_spaces (struct vfs_s_inode *root_inode, size_t
if ((size_t) entry->ino->data_offset > final_num_spaces) if ((size_t) entry->ino->data_offset > final_num_spaces)
{ {
char *source_name = entry->name; char *source_name, *spacer;
char *spacer;
source_name = entry->name;
spacer = g_strnfill (entry->ino->data_offset - final_num_spaces, ' '); spacer = g_strnfill (entry->ino->data_offset - final_num_spaces, ' ');
entry->name = g_strdup_printf ("%s%s", spacer, source_name); entry->name = g_strconcat (spacer, source_name, (char *) NULL);
g_free (spacer); g_free (spacer);
g_free (source_name); g_free (source_name);
} }
entry->ino->data_offset = -1; entry->ino->data_offset = -1;
} }
} }