Call last_component instead of base_name. The latter returns a malloced string since 2006-03-11.

This commit is contained in:
Sergey Poznyakoff
2006-10-31 20:18:50 +00:00
parent f572ca0cfb
commit 7aed52718f
2 changed files with 2 additions and 2 deletions

View File

@@ -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
{

View File

@@ -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;