Skip to content

Commit 1b79e43

Browse files
committed
fix: normalize line endings for cross-platform consistency
1 parent 6a1a154 commit 1b79e43

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/treemapper/tree.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def _read_file_content(file_path: Path, max_file_bytes: Optional[int]) -> str:
112112
return f"<binary file: {file_size} bytes>\n"
113113

114114
content = raw_bytes.decode("utf-8")
115+
content = content.replace("\r\n", "\n").replace("\r", "\n")
115116
cleaned = content.replace("\x00", "")
116117
if cleaned != content:
117118
logging.warning(f"Removed NULL bytes from content of {file_path.name}")

0 commit comments

Comments
 (0)