소스 검색

Merge pull request #95776 from Calinou/crash-handler-linuxbsd-simplify-file-path

Simplify the printed file paths in the Linux/*BSD crash handler
Thaddeus Crews 6 달 전
부모
커밋
dadfcd1ff2
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      platform/linuxbsd/crash_handler_linuxbsd.cpp

+ 2 - 1
platform/linuxbsd/crash_handler_linuxbsd.cpp

@@ -137,7 +137,8 @@ static void handle_crash(int sig) {
 				}
 			}
 
-			print_error(vformat("[%d] %s (%s)", (int64_t)i, fname, err == OK ? addr2line_results[i] : ""));
+			// Simplify printed file paths to remove redundant `/./` sections (e.g. `/opt/godot/./core` -> `/opt/godot/core`).
+			print_error(vformat("[%d] %s (%s)", (int64_t)i, fname, err == OK ? addr2line_results[i].replace("/./", "/") : ""));
 		}
 
 		free(strings);