Unrecognized arguments that start with a double dash were being
treated like composite single dash arguments like -xyz because the
check for the second dash was broken by py3, i.e. by str[i] being an
integer now, rather than b'x'.
The effect was confusing, but not a risk because the resulting
synthetic "--" argument was also unrecognized.
Signed-off-by: Rob Browning <
r...@defaultvalue.org>
Tested-by: Rob Browning <
r...@defaultvalue.org>
---
lib/bup/cmd/get.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bup/cmd/get.py b/lib/bup/cmd/get.py
index 1a16dfd5..7a6c8b64 100644
--- a/lib/bup/cmd/get.py
+++ b/lib/bup/cmd/get.py
@@ -174,7 +174,7 @@ def parse_args(args):
elif arg == b'--bwlimit':
(opt.bwlimit,), remaining = require_n_args_or_die(1, remaining)
opt.bwlimit = int(opt.bwlimit)
- elif arg.startswith(b'-') and len(arg) > 2 and arg[1] != b'-':
+ elif arg.startswith(b'-') and len(arg) > 2 and arg[1] != b'-'[0]:
# Try to interpret this as -xyz, i.e. "-xyz -> -x -y -z".
# We do this last so that --foo -bar is valid if --foo
# requires a value.
--
2.47.3