summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-09-17 15:58:51 +0200
committerGuillem Jover <guillem@debian.org>2011-09-18 08:03:47 +0200
commit49a0022b72df33589fc416c30dc33a82f5f58ea6 (patch)
tree92ceba7ff8a95d5f4792847f4f4772fc83e6a0e1 /src
parentb6b23a82594019d08dcdaf4f8b2a238dce78c945 (diff)
downloaddpkg-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 'src')
-rw-r--r--src/configure.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/configure.c b/src/configure.c
index c75e8c334..a925baf21 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -45,6 +45,7 @@
#include <dpkg/string.h>
#include <dpkg/buffer.h>
#include <dpkg/file.h>
+#include <dpkg/path.h>
#include <dpkg/subproc.h>
#include <dpkg/command.h>
#include <dpkg/triglib.h>
@@ -659,9 +660,7 @@ promptconfaction(struct pkginfo *pkg, const char *cfgfile,
else if (what & cfof_install)
fprintf(stderr, _(" The default action is to install the new version.\n"));
- s = strrchr(cfgfile, '/');
- if (!s || !*++s)
- s = cfgfile;
+ s = path_basename(cfgfile);
fprintf(stderr, "*** %s (Y/I/N/O/D/Z) %s ? ",
s,
(what & cfof_keep) ? _("[default=N]") :