This commit is contained in:
Kovid Goyal
2022-01-02 09:23:25 +05:30
15 changed files with 50 additions and 58 deletions

View File

@@ -55,7 +55,7 @@ create_job(size_t i, size_t blocksz, GlobalData *global) {
if (ans->start >= global->haystack_count) ans->count = 0;
else ans->count = global->haystack_count - ans->start;
ans->max_haystack_len = 0;
for (size_t i = ans->start; i < ans->start + ans->count; i++) ans->max_haystack_len = MAX(ans->max_haystack_len, global->haystack[i].haystack_len);
for (size_t j = ans->start; j < ans->start + ans->count; j++) ans->max_haystack_len = MAX(ans->max_haystack_len, global->haystack[j].haystack_len);
if (ans->count > 0) {
ans->workspace = alloc_workspace(ans->max_haystack_len, global);
if (!ans->workspace) { free(ans); return NULL; }

View File

@@ -219,16 +219,16 @@ def parse_ssh_args(args: List[str]) -> Tuple[List[str], List[str], bool]:
expecting_option_val = False
passthrough = False
stop_option_processing = False
for arg in args:
for argument in args:
if len(server_args) > 1 or stop_option_processing:
server_args.append(arg)
server_args.append(argument)
continue
if arg.startswith('-') and not expecting_option_val:
if arg == '--':
if argument.startswith('-') and not expecting_option_val:
if argument == '--':
stop_option_processing = True
continue
# could be a multi-character option
all_args = arg[1:]
all_args = argument[1:]
for i, arg in enumerate(all_args):
arg = '-' + arg
if arg in passthrough_args:
@@ -247,10 +247,10 @@ def parse_ssh_args(args: List[str]) -> Tuple[List[str], List[str], bool]:
raise InvalidSSHArgs(f'unknown option -- {arg[1:]}')
continue
if expecting_option_val:
ssh_args.append(arg)
ssh_args.append(argument)
expecting_option_val = False
continue
server_args.append(arg)
server_args.append(argument)
if not server_args:
raise InvalidSSHArgs()
return ssh_args, server_args, passthrough

View File

@@ -309,10 +309,6 @@ class ThemesHandler(Handler):
next_line()
next_line()
def write_line(text: str) -> None:
self.write(text)
next_line()
self.cmd.set_cursor_position()
next_line()
self.cmd.styled(theme.name.center(sz), bold=True, fg='green')