mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(vfs_s_normalize_filename_leading_spaces): minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
21376ec1e9
commit
a5826c3f6e
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user