summaryrefslogtreecommitdiff
path: root/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-06-29 11:38:31 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-06-29 11:38:31 +0100
commit90c88731bd036e5698b281fbc0a5f3aa4c9983ac (patch)
tree83fc5facb6b12be510a37bc3d241cc63e965b13a /net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
parentfeb0daf81d888e9160f9f94502de09b66f2a63fd (diff)
gentoo resync : 29.06.2020
Diffstat (limited to 'net-p2p/tremc/files/0.9.1-fix-startup-crash.patch')
-rw-r--r--net-p2p/tremc/files/0.9.1-fix-startup-crash.patch62
1 files changed, 0 insertions, 62 deletions
diff --git a/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch b/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
deleted file mode 100644
index 5e67e5d31555..000000000000
--- a/net-p2p/tremc/files/0.9.1-fix-startup-crash.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 0cb919b446eeda41aea8578ae26796ae92a973e5 Mon Sep 17 00:00:00 2001
-From: George Angelopoulos <george@usermod.net>
-Date: Mon, 2 Jul 2018 17:55:38 +0200
-Subject: [PATCH] fix addch ERR crash when starting with no torrents
-
-There was a bug introduced by commit e06d08d:
- scale_bytes: Simplify this function
-
-tremc would crash when started against a transmission-daemon with no
-torrents.
-
-This was because scale_bytes(0) used to return 0K but now it returns
-0.0K. The expected width of 2 was hardcoded. The new width of 4 causes
-addch() to return ERR because it tries to draw outside the window.
-
-Hardcoding the new width to 4 would resolve this issue. Instead,
-this patch dynamically sets the width returned by scale_bytes().
-This should make the code a tiny bit more readable and maybe avoid this
-issue in the future.
-
-There is one more magic number involved here which I don't see a good
-way of getting rid of. So I made an illustrative comment.
-
-Resolves #15
----
- tremc | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/tremc b/tremc
-index 36ae67b..ed898fb 100755
---- a/tremc
-+++ b/tremc
-@@ -883,7 +883,7 @@ class Interface(object):
- self.focus = -1 # -1: nothing focused; 0: top of list; <# of torrents>-1: bottom of list
- self.scrollpos = 0 # start of torrentlist
- self.torrents_per_page = 0 # will be set by manage_layout()
-- self.rateDownload_width = self.rateUpload_width = 2
-+ self.rateDownload_width = self.rateUpload_width = len(scale_bytes())
-
- self.details_category_focus = 0 # overview/files/peers/tracker in details
- self.focus_detaillist = -1 # same as focus but for details
-@@ -2667,6 +2667,8 @@ class Interface(object):
- pass
-
- def draw_global_rates(self):
-+ # ↑1.2K ↓3.4M
-+ # ^ ^^ => +3
- rates_width = self.rateDownload_width + self.rateUpload_width + 3
-
- if self.stats['alt-speed-enabled']:
-@@ -3373,7 +3375,7 @@ def timestamp(timestamp, format="%x %X"):
- return "%s (%s)" % (absolute, relative)
-
-
--def scale_bytes(bytes, type='short'):
-+def scale_bytes(bytes=0, type='short'):
- if bytes >= 1099511627776:
- scaled_bytes = round((bytes / 1099511627776.0), 1)
- unit = 'T'
---
-2.26.0
-