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 /src | |
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 'src')
-rw-r--r-- | src/configure.c | 5 |
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]") : |