-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Description
This code example (Windows platform):
echo TESTTEST> index.html
curl -fR -z .\index.html https://example.org/index.html -o .\index.html.newer
echo %ERRORLEVEL%
will create a zero-length file and return result code 0 when using curl 7.42.0.
In previous versions it was returning result 0 but the zero-length file was not created, which seems to be the correct behavior, given that -z means to download only if there is a newer than the reference-file found on the server. New behavior also makes it not possible to use -z
either by checking the result code (always 0) or the existence of the output (always created).
This seems to be related to update #183. Here, the description "curl: create output file on successful download of an empty file" (and Daniel's video) suggests that a zero-length file is only expected if the server actually serves a zero-length file, which is not the case in above scenario; the file on the server has a length of 1270 bytes.
Therefore I believe this to be a bug.