mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-19 01:04:38 -04:00
gzip: use success status when file already has compressed suffix
This matches the behavior of GNU gzip.
This commit is contained in:
parent
b620773954
commit
ed923c45d4
@ -384,8 +384,7 @@ compress_file(struct libdeflate_compressor *compressor, const tchar *path,
|
|||||||
if (!options->force && has_suffix(path, options->suffix)) {
|
if (!options->force && has_suffix(path, options->suffix)) {
|
||||||
msg("%"TS": already has %"TS" suffix -- skipping",
|
msg("%"TS": already has %"TS" suffix -- skipping",
|
||||||
path, options->suffix);
|
path, options->suffix);
|
||||||
ret = -2;
|
return 0;
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
path_nchars = tstrlen(path);
|
path_nchars = tstrlen(path);
|
||||||
suffix_nchars = tstrlen(options->suffix);
|
suffix_nchars = tstrlen(options->suffix);
|
||||||
@ -439,7 +438,6 @@ out_close_in:
|
|||||||
tunlink(path);
|
tunlink(path);
|
||||||
out_free_newpath:
|
out_free_newpath:
|
||||||
free(newpath);
|
free(newpath);
|
||||||
out:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user