mirror of
https://github.com/curl/curl.git
synced 2026-06-08 05:24:15 +03:00
make %Z portable too
This commit is contained in:
parent
958b3c1105
commit
5eec4c04db
2 changed files with 5 additions and 2 deletions
|
|
@ -585,11 +585,14 @@ static const char *outtime(const char *ptr, /* %time{ ... */
|
|||
|
||||
/* insert sub-seconds for %f */
|
||||
/* insert +0000 for %z because it is otherwise not portable */
|
||||
/* insert UTC for %Z because it is otherwise not portable */
|
||||
for(i = 0; !result && i < vlen; i++) {
|
||||
if((i < vlen - 1) && ptr[i] == '%' &&
|
||||
((ptr[i + 1] == 'f') || (ptr[i + 1] == 'z'))) {
|
||||
((ptr[i + 1] == 'f') || ((ptr[i + 1] | 0x20) == 'z'))) {
|
||||
if(ptr[i + 1] == 'f')
|
||||
result = curlx_dyn_addf(&format, "%06u", usecs);
|
||||
else if(ptr[i + 1] == 'Z')
|
||||
result = curlx_dyn_addn(&format, "UTC", 3);
|
||||
else
|
||||
result = curlx_dyn_addn(&format, "+0000", 5);
|
||||
i++;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ Accept: */*
|
|||
|
||||
</protocol>
|
||||
<stdout mode="text">
|
||||
Time: 01/Aug/2025 08:31:43.037103 +0000 GMT
|
||||
Time: 01/Aug/2025 08:31:43.037103 +0000 UTC
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue