X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/f8295b32a98df79caee16a25a1dcf3a7a678e409..e5fa9ca748b73c6008754ce2c48e9a85a78a1f17:/src/lbxtool.c diff --git a/src/lbxtool.c b/src/lbxtool.c index 754592f..9c4b57b 100644 --- a/src/lbxtool.c +++ b/src/lbxtool.c @@ -26,7 +26,7 @@ #include "tools.h" #include "lbx.h" - +#include "error.h" static void printusage(void) { @@ -81,7 +81,7 @@ int list(LBX *lbx, int verbose, char **argv) { for (i = 0; i < nfiles; i++) { struct lbx_statbuf stat; - lbx_stat(lbx, i, &stat); + lbx_file_stat(lbx, i, &stat); switch (filematch(argv, stat.name)) { case -1: continue; @@ -156,7 +156,7 @@ int extract(LBX *lbx, int verbose, char **argv) { struct lbx_statbuf stat; LBXfile *file; - lbx_stat(lbx, i, &stat); + lbx_file_stat(lbx, i, &stat); switch (filematch(argv, stat.name)) { case -1: continue; @@ -166,8 +166,7 @@ int extract(LBX *lbx, int verbose, char **argv) { file = lbx_file_open(lbx, i); if (!file) { - errmsg("failed to open archive member %s: %s.\n", - stat.name, lbx_strerror()); + errmsg("%s: %s.\n", stat.name, lbx_errmsg()); continue; } @@ -241,7 +240,7 @@ int main(int argc, char **argv) lbx = lbx_open(&stdin_handle, &lbx_pipe_fops, NULL, "stdin"); if (!lbx) { - errmsg("failed to open archive: %s.\n", lbx_strerror()); + errmsg("%s: %s.\n", file ? file : "stdin", lbx_errmsg()); return EXIT_FAILURE; }