summaryrefslogtreecommitdiff
path: root/mpq-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpq-file.c')
-rw-r--r--mpq-file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mpq-file.c b/mpq-file.c
index 608f42d..149f824 100644
--- a/mpq-file.c
+++ b/mpq-file.c
@@ -116,8 +116,12 @@ struct mpq_file_t * mpqlib_open_file(struct mpq_archive_t * mpq_a, int entry) {
struct mpq_file_t * mpqlib_open_filename(struct mpq_archive_t * mpq_a, const char * fname) {
int e;
- if ((e = mpqlib_find_hash_entry_by_name(mpq_a, fname, 0, 0)) < 0)
+ __mpqlib_errno = MPQLIB_ERROR_NO_ERROR;
+
+ if ((e = mpqlib_find_hash_entry_by_name(mpq_a, fname, 0, 0)) < 0) {
+ __mpqlib_errno = MPQLIB_ERROR_FILE_NOT_FOUND;
return NULL;
+ }
return mpqlib_open_file(mpq_a, e);
}