From 1b8a1d4140c58030bc71665eef4dc3485812817e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Oct 2013 00:35:58 +0200 Subject: ArchiveLookup: return const strings --- src/ArchiveLookup.cxx | 4 +++- src/ArchiveLookup.hxx | 4 +++- src/input/ArchiveInputPlugin.cxx | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ArchiveLookup.cxx b/src/ArchiveLookup.cxx index 8cd87f5ec..7cea655fd 100644 --- a/src/ArchiveLookup.cxx +++ b/src/ArchiveLookup.cxx @@ -29,7 +29,9 @@ #include #include -bool archive_lookup(char *pathname, char **archive, char **inpath, char **suffix) +bool +archive_lookup(char *pathname, const char **archive, + const char **inpath, const char **suffix) { char *pathdupe; int len, idx; diff --git a/src/ArchiveLookup.hxx b/src/ArchiveLookup.hxx index 62ebbc0c5..0c4da9c93 100644 --- a/src/ArchiveLookup.hxx +++ b/src/ArchiveLookup.hxx @@ -37,7 +37,9 @@ * inarchive pathname: Talco - Combat Circus/12 - A la pachenka.mp3 * and suffix: zip */ -bool archive_lookup(char *pathname, char **archive, char **inpath, char **suffix); +bool +archive_lookup(char *pathname, const char **archive, + const char **inpath, const char **suffix); #endif diff --git a/src/input/ArchiveInputPlugin.cxx b/src/input/ArchiveInputPlugin.cxx index a43340994..84f0ca168 100644 --- a/src/input/ArchiveInputPlugin.cxx +++ b/src/input/ArchiveInputPlugin.cxx @@ -45,14 +45,14 @@ input_archive_open(const char *pathname, Error &error) { const struct archive_plugin *arplug; - char *archive, *filename, *suffix, *pname; struct input_stream *is; if (!Path::IsAbsoluteFS(pathname)) return NULL; - pname = g_strdup(pathname); + char *pname = g_strdup(pathname); // archive_lookup will modify pname when true is returned + const char *archive, *filename, *suffix; if (!archive_lookup(pname, &archive, &filename, &suffix)) { FormatDebug(archive_domain, "not an archive, lookup %s failed", pname); -- cgit v1.2.3