From f6b28575cc560682cc822c282323cb6cb378f3e3 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Thu, 25 Dec 2014 12:06:33 +0100 Subject: [PATCH] src/main.c, src/warc.c: Use gnulib's base_name() instead of basename() Reported-by: Eli Zaretskii --- src/main.c | 2 +- src/warc.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 8f38b1c6..6feb1403 100644 --- a/src/main.c +++ b/src/main.c @@ -1034,7 +1034,7 @@ main (int argc, char **argv) /* On VMS, lose the "dev:[dir]" prefix and the ".EXE;nnn" suffix. */ exec_name = vms_basename (argv[0]); #else /* def __VMS */ - exec_name = basename (argv[0]); + exec_name = base_name (argv[0]); #endif /* def __VMS [else] */ #ifdef WINDOWS diff --git a/src/warc.c b/src/warc.c index f23d381c..5ae21a51 100644 --- a/src/warc.c +++ b/src/warc.c @@ -684,7 +684,7 @@ warc_write_warcinfo_record (char *filename) warc_timestamp (timestamp, sizeof(timestamp)); - filename_basename = basename (filename); + filename_basename = base_name (filename); warc_write_start_record (); warc_write_header ("WARC-Type", "warcinfo"); @@ -693,6 +693,8 @@ warc_write_warcinfo_record (char *filename) warc_write_header ("WARC-Record-ID", warc_current_warcinfo_uuid_str); warc_write_header ("WARC-Filename", filename_basename); + xfree (filename_basename); + /* Create content. */ warc_tmp = warc_tempfile (); if (warc_tmp == NULL)