From 1182aeea008d177b51a09c311f4fe845780198fa Mon Sep 17 00:00:00 2001 From: alireza78a Date: Wed, 11 Mar 2026 21:51:25 +0330 Subject: [PATCH] fix(patch): use regex to detect line-number prefix to avoid corrupting pipe chars --- tools/patch_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patch_parser.py b/tools/patch_parser.py index 716036f38d..bef196e505 100644 --- a/tools/patch_parser.py +++ b/tools/patch_parser.py @@ -359,7 +359,7 @@ def _apply_update(op: PatchOperation, file_ops: Any) -> Tuple[bool, str]: # Parse content (remove line numbers) current_lines = [] for line in read_result.content.split('\n'): - if '|' in line: + if re.match(r'^\s*\d+\|', line): # Line format: " 123|content" parts = line.split('|', 1) if len(parts) == 2: