Преглед на файлове

Simplify printed file paths in the Linux/*BSD crash handler

This shortens the printed paths a bit when they would contain `/./`,
which is redundant (e.g. `/opt/godot/./core` becomes `/opt/godot/core`).
Hugo Locurcio преди 11 месеца
родител
ревизия
57141e04a6
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      platform/linuxbsd/crash_handler_linuxbsd.cpp

+ 2 - 1
platform/linuxbsd/crash_handler_linuxbsd.cpp

@@ -133,7 +133,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);
 		free(strings);