amagnasco / xwpe

Upload of an abandoned ncurses-based programming environment
http://www.identicalsoftware.com/xwpe/
GNU General Public License v2.0
29 stars 6 forks source link

Mistyped define for HAVE_LIBZ : HAS_LIBZ #53

Closed gbonnema closed 7 years ago

gbonnema commented 7 years ago

The program we_fl_fkt.c tests the define of HAS_LIBZ. This is a typo and should have been HAVE_LIBZ. That will have caused some trouble. I am in the process of checking all defines in order to get the new autotool files in order (issue #51) and will solve it in that branch.

EDIT: it turns out that this type had all code relaiing to reading gzip files disabled, in stead using the code for if the gzip library code is not available, irrespective of whether the z-library is available or not.

As a consequence the code for handling gzip had a flaw that -- once corrected -- made the other code (where the z-lib is not available) invalid. So I had to correct both code sides to make the code compile again. The code changes for this is issue I included in the changes for autotools, because as a result of this change I am checking all defines.

Once I pull requested this branch, we will really need to test this issue specifically, because code for a compile both with and without z-lib has a fundamental change.

Description of the change

The error was a typedef for IFILE used both with and without z-lib, where with zlib IFILE is a typedef of gzFile (which is a pointer) and without zlib IFILE is a struct. All the code used a pointer to IFILE, and this caused the problems.

The functions of z-lib being used needed a IFILE (gzFile is already a pointer), while the code assumed it needed an IFILE . After correction of this, the non-z-lib code stopped working, because it needed a pointer to struct. The solution was to name the struct ifile_s and make a typedef of IFILE to ifile_s .

This compiles and seems to work, but as the code using z-lib has always been excluded (as long as the type HAS_ZLIB existed), we can assume that at least the z-lib code is untested. One can only assume that bugs still have to emerge. So we will need some rigorous testing once I included this patch into experimentals or into a branch from experimental, whichever we prefer.

gbonnema commented 7 years ago

Issue was solved in the autotools modification. Closing issue.