From: Sergey Poznyakoff Date: Tue, 31 Oct 2006 20:18:50 +0000 (+0000) Subject: Call last_component instead of base_name. The latter returns a malloced string since... X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=7aed52718f1b2e031450af0e2468006bd78ccfcd;p=chaz%2Ftar Call last_component instead of base_name. The latter returns a malloced string since 2006-03-11. --- diff --git a/src/extract.c b/src/extract.c index 0ff01a9..148fdfc 100644 --- a/src/extract.c +++ b/src/extract.c @@ -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 { diff --git a/src/xheader.c b/src/xheader.c index 2948859..5676dca 100644 --- a/src/xheader.c +++ b/src/xheader.c @@ -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;