aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/archive_input_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/archive_input_plugin.c')
-rw-r--r--src/input/archive_input_plugin.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/input/archive_input_plugin.c b/src/input/archive_input_plugin.c
index 8e897f0c2..53d472a5a 100644
--- a/src/input/archive_input_plugin.c
+++ b/src/input/archive_input_plugin.c
@@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "config.h"
#include "input/archive_input_plugin.h"
#include "archive_api.h"
#include "archive_list.h"
@@ -33,14 +34,15 @@
* plugin and gzip fetches file from disk
*/
static bool
-input_archive_open(struct input_stream *is, const char *pathname)
+input_archive_open(struct input_stream *is, const char *pathname,
+ GError **error_r)
{
const struct archive_plugin *arplug;
struct archive_file *file;
char *archive, *filename, *suffix, *pname;
bool opened;
- if (pathname[0] != '/')
+ if (!g_path_is_absolute(pathname))
return false;
pname = g_strdup(pathname);
@@ -59,18 +61,20 @@ input_archive_open(struct input_stream *is, const char *pathname)
return false;
}
- file = arplug->open(archive);
+ file = archive_file_open(arplug, archive, error_r);
+ if (file == NULL)
+ return false;
//setup fileops
- opened = arplug->open_stream(file, is, filename);
+ opened = archive_file_open_stream(file, is, filename, error_r);
+ g_free(pname);
if (!opened) {
- g_warning("open inarchive file %s failed\n\n",filename);
- arplug->close(file);
+ archive_file_close(file);
} else {
is->ready = true;
}
- g_free(pname);
+
return opened;
}