mirror of
https://github.com/openai/codex.git
synced 2026-11-03 19:53:25 +00:00
Fix line ending stuff
This commit is contained in:
@@ -379,6 +379,7 @@ fn sanitize_value(value: &mut Value, replacements: &[(String, &'static str)]) {
|
||||
current = current.replace(pattern, replacement);
|
||||
}
|
||||
}
|
||||
normalize_line_endings(&mut current);
|
||||
*s = current;
|
||||
}
|
||||
Value::Array(items) => {
|
||||
@@ -394,3 +395,10 @@ fn sanitize_value(value: &mut Value, replacements: &[(String, &'static str)]) {
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn normalize_line_endings(text: &mut String) {
|
||||
if text.contains('\r') {
|
||||
let normalized = text.replace("\r\n", "\n").replace('\r', "\n");
|
||||
*text = normalized;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user