mirror of
https://github.com/curl/curl.git
synced 2026-07-26 06:27:32 +03:00
tool_filetime: accept setting negative filetime
This allows --remote-time to set dates before 1970. Due to a minor omission in the API, it will still avoid setting the time if it is indeed exactly epoch 0 (jan 1 1970). Verified by test 762 Fixes #18424 Reported-by: Terence Eden Closes #18443
This commit is contained in:
parent
a5798a51f0
commit
54f1ef05d6
3 changed files with 59 additions and 2 deletions
|
|
@ -88,7 +88,7 @@ int getfiletime(const char *filename, curl_off_t *stamp)
|
|||
#if defined(HAVE_UTIME) || defined(HAVE_UTIMES) || defined(_WIN32)
|
||||
void setfiletime(curl_off_t filetime, const char *filename)
|
||||
{
|
||||
if(filetime >= 0) {
|
||||
if(filetime) {
|
||||
/* Windows utime() may attempt to adjust the Unix GMT file time by a daylight
|
||||
saving time offset and since it is GMT that is bad behavior. When we have
|
||||
access to a 64-bit type we can bypass utime and set the times directly. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue