mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
NIT windows
This commit is contained in:
@@ -41,7 +41,7 @@ fn windows_split_command_line(input: &str) -> Option<Vec<String>> {
|
||||
backslashes += 1;
|
||||
}
|
||||
'"' => {
|
||||
current.extend(std::iter::repeat('\\').take(backslashes / 2));
|
||||
current.extend(std::iter::repeat_n('\\', backslashes / 2));
|
||||
if backslashes % 2 == 0 {
|
||||
in_quotes = !in_quotes;
|
||||
} else {
|
||||
@@ -50,14 +50,14 @@ fn windows_split_command_line(input: &str) -> Option<Vec<String>> {
|
||||
backslashes = 0;
|
||||
}
|
||||
c if c.is_whitespace() && !in_quotes => {
|
||||
current.extend(std::iter::repeat('\\').take(backslashes));
|
||||
current.extend(std::iter::repeat_n('\\', backslashes));
|
||||
backslashes = 0;
|
||||
if !current.is_empty() {
|
||||
args.push(std::mem::take(&mut current));
|
||||
}
|
||||
}
|
||||
other => {
|
||||
current.extend(std::iter::repeat('\\').take(backslashes));
|
||||
current.extend(std::iter::repeat_n('\\', backslashes));
|
||||
backslashes = 0;
|
||||
current.push(other);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ fn windows_split_command_line(input: &str) -> Option<Vec<String>> {
|
||||
return None;
|
||||
}
|
||||
|
||||
current.extend(std::iter::repeat('\\').take(backslashes));
|
||||
current.extend(std::iter::repeat_n('\\', backslashes));
|
||||
if !current.is_empty() {
|
||||
args.push(current);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user