mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-08-15 02:27:49 +00:00
Merge pull request #29 from francois-berder/master
Various improvements -- thank you!
This commit is contained in:
@@ -96,6 +96,6 @@ int lzsa_dictionary_load(const char *pszDictionaryFilename, void **ppDictionaryD
|
|||||||
void lzsa_dictionary_free(void **ppDictionaryData) {
|
void lzsa_dictionary_free(void **ppDictionaryData) {
|
||||||
if (*ppDictionaryData) {
|
if (*ppDictionaryData) {
|
||||||
free(*ppDictionaryData);
|
free(*ppDictionaryData);
|
||||||
ppDictionaryData = NULL;
|
*ppDictionaryData = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -277,8 +277,10 @@ int comparestream_open(lzsa_stream_t *stream, const char *pszCompareFilename, co
|
|||||||
stream->close = comparestream_close;
|
stream->close = comparestream_close;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
free(pCompareStream);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_compare(const char *pszInFilename, const char *pszOutFilename, const char *pszDictionaryFilename, const unsigned int nOptions, int nFormatVersion) {
|
static int do_compare(const char *pszInFilename, const char *pszOutFilename, const char *pszDictionaryFilename, const unsigned int nOptions, int nFormatVersion) {
|
||||||
@@ -1052,7 +1054,9 @@ int main(int argc, char **argv) {
|
|||||||
if (cCommand == 'z') {
|
if (cCommand == 'z') {
|
||||||
int nResult = do_compress(pszInFilename, pszOutFilename, pszDictionaryFilename, nOptions, nMinMatchSize, nFormatVersion);
|
int nResult = do_compress(pszInFilename, pszOutFilename, pszDictionaryFilename, nOptions, nMinMatchSize, nFormatVersion);
|
||||||
if (nResult == 0 && bVerifyCompression) {
|
if (nResult == 0 && bVerifyCompression) {
|
||||||
nResult = do_compare(pszOutFilename, pszInFilename, pszDictionaryFilename, nOptions, nFormatVersion);
|
return do_compare(pszOutFilename, pszInFilename, pszDictionaryFilename, nOptions, nFormatVersion);
|
||||||
|
} else {
|
||||||
|
return nResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cCommand == 'd') {
|
else if (cCommand == 'd') {
|
||||||
|
Reference in New Issue
Block a user