Description
I did this
$:/tmp> curl --fail --retry 1 -o test.down https://curl.se/download/curl-8.14.2.tar.gz; echo $?
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
0
Note: the return code is 0 instead of 22
Works at least with curl 8.13
I expected the following
$:/tmp> curl --fail -o test.down https://curl.se/download/curl-8.14.2.tar.gz; echo $?
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
22
curl/libcurl version
$:/tmp> curl --version
curl 8.14.1 (x86_64-pc-linux-gnu) libcurl/8.14.1 OpenSSL/3.5.0 zlib/1.3.1 zstd/1.5.7 nghttp2/1.65.0
Release-Date: 2025-06-04
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM SSL threadsafe TLS-SRP UnixSockets zstd
operating system
CRUX 3.8