(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
1 changed files with 4 additions and 3 deletions

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)
{
char *source_name = entry->name;
char *spacer;
char *source_name, *spacer;
source_name = entry->name;
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 (source_name);
}
entry->ino->data_offset = -1;
}
}