From: Viljar Indus <in...@adacore.com>

gcc/ada/ChangeLog:

        * errout.adb (Write_JSON_Location): Avoid going through
        symbolic links when printing the full name.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/errout.adb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 7e24970f187..3c499273ab7 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -2372,7 +2372,8 @@ package body Errout is
          Write_Str ("{""file"":""");
          if Full_Path_Name_For_Brief_Errors then
             Write_JSON_Escaped_String
-              (System.OS_Lib.Normalize_Pathname (Get_Name_String (Name)));
+              (System.OS_Lib.Normalize_Pathname
+                 (Get_Name_String (Name), Resolve_Links => False));
          else
             Write_Name (Name);
          end if;
-- 
2.43.0

Reply via email to