Skip to content

Instantly share code, notes, and snippets.

@krofna
Created July 17, 2013 20:28
Show Gist options
  • Save krofna/6024145 to your computer and use it in GitHub Desktop.
Save krofna/6024145 to your computer and use it in GitHub Desktop.
--- src/old-progress.c 2013-07-17 22:27:06.117758105 +0200
+++ src/progress.c 2013-07-17 22:26:28.377758689 +0200
@@ -918,24 +918,24 @@ create_image (struct bar_progress *bp, d
assert (dlsz <= progress_size);
assert (insz <= dlsz);
- *p++ = '[';
+ *p++ = 'B';
begin = p;
+ for (i = 0; i < progress_size - insz - dlsz - 1; ++i)
+ *p++ = '~';
+ *p++ = '<';
+
/* Print the initial portion of the download with '+' chars, the
rest with '=' and one '>'. */
- for (i = 0; i < insz; i++)
- *p++ = '+';
- dlsz -= insz;
- if (dlsz > 0)
- {
- for (i = 0; i < dlsz - 1; i++)
- *p++ = '=';
- *p++ = '>';
- }
+ for (i = 0; i < dlsz - insz; i++)
+ *p++ = '=';
+ if (insz > 0)
+ for (i = 0; i < insz; i++)
+ *p++ = '-';
while (p - begin < progress_size)
- *p++ = ' ';
- *p++ = ']';
+ *p++ = '=';
+ *p++ = '3';
}
else if (progress_size)
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment