wget: display 100% at the _end_ of chunked download
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 11 Feb 2011 22:06:21 +0000 (23:06 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 11 Feb 2011 22:06:21 +0000 (23:06 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/wget.c

index 4ef5900cb3919404dd75655276edeaa624485b31..44eb4cf188a1bc9cffabe30dc8f208ee39ce3e37 100644 (file)
@@ -556,9 +556,8 @@ static void NOINLINE retrieve_file_data(FILE *dfp, int output_fd)
                }
 #if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
                clearerr(dfp);
-               ndelay_off(polldata.fd);
+               ndelay_off(polldata.fd); /* else fgets can get very unhappy */
 #endif
-
                if (!G.chunked)
                        break;
 
@@ -572,6 +571,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp, int output_fd)
                G.got_clen = 1;
        }
 
+       G.chunked = 0; /* make progress meter show 100% even for chunked */
        progress_meter(PROGRESS_END);
 }