Call last_component instead of base_name. The latter returns a malloced string since 2006-03-11.
This commit is contained in:
@@ -871,7 +871,7 @@ create_placeholder_file (char *file_name, bool is_symlink, int *interdir_made)
|
||||
if (h && ! h->after_links
|
||||
&& strncmp (file_name, h->file_name, h->file_name_len) == 0
|
||||
&& ISSLASH (file_name[h->file_name_len])
|
||||
&& (base_name (file_name) == file_name + h->file_name_len + 1))
|
||||
&& (last_component (file_name) == file_name + h->file_name_len + 1))
|
||||
{
|
||||
do
|
||||
{
|
||||
|
||||
@@ -264,7 +264,7 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
|
||||
case 'f':
|
||||
if (st)
|
||||
{
|
||||
base = base_name (st->orig_file_name);
|
||||
base = last_component (st->orig_file_name);
|
||||
len += strlen (base) - 2;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user