]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
url-lib.sh: handle 0-size files with curl
authorHarald Hoyer <harald@redhat.com>
Tue, 20 Aug 2013 14:15:17 +0000 (16:15 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 20 Aug 2013 14:15:17 +0000 (16:15 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=989133#c9

modules.d/45url-lib/url-lib.sh

index 34d42ba5d7d5447900947403bfb87e4d515db4df..12df9b4c8d351dc2eefe57377bc2c8f87bf4b6eb 100755 (executable)
@@ -64,7 +64,7 @@ curl_fetch_url() {
     local url="$1" outloc="$2"
     echo "$url" > /proc/self/fd/0
     if [ -n "$outloc" ]; then
-        curl $curl_args --output "$outloc" -- "$url" || return $?
+        curl $curl_args --output - -- "$url" > "$outloc" || return $?
     else
         local outdir="$(mkuniqdir /tmp curl_fetch_url)"
         ( cd "$outdir"; curl $curl_args --remote-name "$url" || return $? )