From af7cc3dd2b292efbe695af297edd6f1cdcca6f76 Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Mon, 7 Oct 2019 05:07:06 +0100 Subject: [PATCH] Improve checks for +/- in diff line (#359) There could exist a scenario when a +/- would be not at the start of the string. Current code would fail in this case. Instead we should check that the first character of the string is +/-. This following on from PR # 356 https://github.com/borgbase/vorta/pull/356 --- src/vorta/views/diff_result.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vorta/views/diff_result.py b/src/vorta/views/diff_result.py index ac54e736..1da7cbc9 100644 --- a/src/vorta/views/diff_result.py +++ b/src/vorta/views/diff_result.py @@ -43,7 +43,7 @@ class DiffResult(DiffResultBase, DiffResultUI): size = line_split[0] unit = line_split[1] # If present remove '+' or '-' sign at the front - if '+' in size or '-' in size: + if size[0] in ('+', '-'): size = size[1:] if line_split[0].startswith("["):