This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH PR d/87866] Committed use lrealpath to get canonical name


Hi,

This patch fixes PR d/87866. The libiberty function is more portable
than the one provided by the dmd front-end.  I checked other places
where FileName::canonicalName is used internally to dmd, but found
none that would be used by us.

Bootstrapped, ran D2 testsuite on x86_64-linux-gnu.  Commited to trunk
as r266429.

Iain

---
gcc/d/ChangeLog:

2018-11-24  Iain Buclaw  <ibuclaw@gdcproject.org>

    PR d/87866
    * d-incpath.cc (add_globalpaths): Use lrealpath to get canonical name.
    (add_filepaths): Likewise.

---
diff --git a/gcc/d/d-incpath.cc b/gcc/d/d-incpath.cc
index be08ccb5f3b..87db8164134 100644
--- a/gcc/d/d-incpath.cc
+++ b/gcc/d/d-incpath.cc
@@ -78,7 +78,7 @@ add_globalpaths (Strings *paths)
       for (size_t i = 0; i < paths->dim; i++)
 	{
 	  const char *path = (*paths)[i];
-	  const char *target = FileName::canonicalName (path);
+	  const char *target = lrealpath (path);
 
 	  if (target == NULL || !FileName::exists (target))
 	    {
@@ -105,7 +105,7 @@ add_filepaths (Strings *paths)
       for (size_t i = 0; i < paths->dim; i++)
 	{
 	  const char *path = (*paths)[i];
-	  const char *target = FileName::canonicalName (path);
+	  const char *target = lrealpath (path);
 
 	  if (!FileName::exists (target))
 	    {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]