You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: avoid unicode filepath suffix panic
* fix: prevent unicode char boundary panics in all constraint functions
The previous fix (a09292e) only guarded path_ends_with_suffix with
path.get(start..), but three problems remained:
1. path_ends_with_suffix: path_bytes[start - 1] reads inside a
multi-byte char when start is a valid boundary but start-1 is not.
Fixed by scanning backward to find the preceding ASCII byte.
2. path_contains_segment: path[..segment_len] and path[start..end]
slice at non-char-boundary offsets when segment is ASCII but the
path contains multi-byte UTF-8 (Korean, etc).
Fixed with is_char_boundary() checks before each slice.
3. file_has_extension: same byte-offset issue for dot_pos.
Fixed with is_char_boundary() check.
Adds regression tests with the exact Korean filenames that caused
panics (커리큘럼, 세부_커리큘럼_최종, 설치-및-기본-사용, etc).
Merges upstream unicode tests (apostrophe, narrow-space mismatches).
---------
Co-authored-by: Dmitriy Kovalenko <dmtr.kovalenko@outlook.com>
let path1 = "Downloads/(커리큘럼) hermes agent_정승현님 - 1차 커리큘럼 (강사님 작성).csv";
657
+
let path2 = "hermes-agent-lecture-materials/세부_커리큘럼_최종.csv";
658
+
let path3 = "projects/fastcampus-hermes-agent-curriculum/chapters/part-02-Hermes-설치-및-기본-사용/section-02-doctor로-설치-상태-검증/research/03-fix가-자동-수정하는-것과-못하는-것.md";
659
+
660
+
// These must not panic regardless of segment/suffix used
0 commit comments