diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-03-26 13:57:23 (EDT) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-03-26 13:57:23 (EDT) |
commit | 897c4599befe8d8d8afd6222d34d1d9229f15f61 (patch) | |
tree | 2fad3b8d5215eddb3e317bedcdae5d330a185135 /libopkg | |
parent | 80fa18779f694b6643f4bf711e72168092aba800 (diff) |
Due to deb_extract's defect that I cannot tell if an extraction is
successfull or failed via the return value.
Therefore I cannot use it as error message.
revert some code of R206
git-svn-id: http://opkg.googlecode.com/svn/trunk@208 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r-- | libopkg/pkg_extract.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libopkg/pkg_extract.c b/libopkg/pkg_extract.c index 0aae4ad..7f22ff3 100644 --- a/libopkg/pkg_extract.c +++ b/libopkg/pkg_extract.c @@ -65,10 +65,12 @@ int pkg_extract_control_files_to_dir_with_prefix(pkg_t *pkg, free(dir_with_prefix); - if (buffer == NULL) { - return EINVAL; + /* BUG: How do we know if deb_extract worked or not? This is a + defect in the current deb_extract from what I can tell. */ + + if (buffer) { + free(buffer); } - free(buffer); return 0; } @@ -81,10 +83,12 @@ int pkg_extract_data_files_to_dir(pkg_t *pkg, const char *dir) | extract_unconditional, dir, NULL); - if (buffer == NULL) { - return EINVAL; + /* BUG: How do we know if deb_extract worked or not? This is a + defect in the current deb_extract from what I can tell. */ + + if (buffer) { + free(buffer); } - free(buffer); return 0; } @@ -170,9 +174,8 @@ int pkg_extract_data_file_names_to_stream(pkg_t *pkg, FILE *file) /* BUG: How do we know if deb_extract worked or not? This is a defect in the current deb_extract from what I can tell. */ - if (buffer == NULL) { - return EINVAL; + if (buffer) { + free(buffer); } - free(buffer); return 0; } |