diff options
author | Guillem Jover <guillem@debian.org> | 2011-09-17 15:58:51 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2011-09-18 08:03:47 +0200 |
commit | 49a0022b72df33589fc416c30dc33a82f5f58ea6 (patch) | |
tree | 92ceba7ff8a95d5f4792847f4f4772fc83e6a0e1 /dpkg-split | |
parent | b6b23a82594019d08dcdaf4f8b2a238dce78c945 (diff) | |
download | dpkg-49a0022b72df33589fc416c30dc33a82f5f58ea6.tar.gz |
libdpkg: Refactor path basename code into new path_basename function
This function is an equivalent of the GNU basename, but this one will
work consistently on any system regardless of libc used.
Diffstat (limited to 'dpkg-split')
-rw-r--r-- | dpkg-split/split.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/dpkg-split/split.c b/dpkg-split/split.c index 1b40f348f..cae453103 100644 --- a/dpkg-split/split.c +++ b/dpkg-split/split.c @@ -3,7 +3,7 @@ * split.c - splitting archives * * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk> - * Copyright © 2010 Guillem Jover <guillem@debian.org> + * Copyright © 2008-2011 Guillem Jover <guillem@debian.org> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ #include <dpkg/i18n.h> #include <dpkg/dpkg.h> #include <dpkg/dpkg-db.h> +#include <dpkg/path.h> #include <dpkg/subproc.h> #include <dpkg/buffer.h> #include <dpkg/ar.h> @@ -160,10 +161,7 @@ mksplit(const char *file_src, const char *prefix, off_t maxpartsize, prefixdir = m_strdup(dirname(t)); free(t); - t = m_strdup(prefix); - msdos_prefix = m_strdup(basename(t)); - free(t); - + msdos_prefix = m_strdup(path_basename(prefix)); prefix = clean_msdos_filename(msdos_prefix); } |