~ubuntu-branches/ubuntu/vivid/curl/vivid

« back to all changes in this revision

Viewing changes to debian/progress-bar.patch

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2002-03-12 19:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20020312190621-iztop53k88qlo29k
Tags: 7.9.5-1
* New upstream version (Closes: #134608).
* Added autotools-dev to the build dependencies. config.{guess,sub}
  can now be updated automatically in the build process.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- src/main.c.old      Sun Mar 10 01:28:17 2002
 
2
+++ src/main.c  Sun Mar 10 01:27:16 2002
 
3
@@ -1733,18 +1733,19 @@
 
4
 }
 
5
 
 
6
 struct ProgressData {
 
7
-  size_t total;
 
8
-  size_t prev;
 
9
-  size_t point;
 
10
+  int calls;
 
11
+  double total;
 
12
+  double prev;
 
13
+  double point;
 
14
   int width;
 
15
   FILE *out; /* where to write everything to */
 
16
 };
 
17
 
 
18
 int myprogress (void *clientp,
 
19
-                size_t dltotal,
 
20
-                size_t dlnow,
 
21
-                size_t ultotal,
 
22
-                size_t ulnow)
 
23
+                double dltotal,
 
24
+                double dlnow,
 
25
+                double ultotal,
 
26
+                double ulnow)
 
27
 {
 
28
   /* The original progress-bar source code was written for curl by Lars Aas,
 
29
      and this new edition inherites some of his concepts. */
 
30
@@ -1763,6 +1764,8 @@
 
31
 
 
32
   bar->point = dlnow + ulnow; /* we've come this far */
 
33
 
 
34
+  bar->calls++; /* simply count invokes */
 
35
+
 
36
   if(0 == total) {
 
37
     int prevblock = bar->prev / 1024;
 
38
     int thisblock = bar->point / 1024;
 
39
@@ -2403,6 +2406,13 @@
 
40
       
 
41
       res = curl_easy_perform(curl);
 
42
         
 
43
+      if((config->progressmode == CURL_PROGRESS_BAR) &&
 
44
+         progressbar.calls) {
 
45
+        /* if the custom progress bar has been displayed, we output a
 
46
+           newline here */
 
47
+        fputs("\n", progressbar.out);
 
48
+      }
 
49
+
 
50
       if(config->writeout) {
 
51
         ourWriteOut(curl, config->writeout);
 
52
       }