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
This commit is contained in:
Philip Roche 2019-10-07 05:07:06 +01:00 committed by Manuel Riel
parent bf7185c5f2
commit af7cc3dd2b
1 changed files with 1 additions and 1 deletions

View File

@ -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("["):