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

Message ID CABOHX+dxyJ9yEiY42jaeJHcca9Mc5cYwFEHwNGApQJtCnM9Ayg@mail.gmail.com
State New
Headers show
Series
  • [PR,d/87866] Committed use lrealpath to get canonical name
Related show

Commit Message

Iain Buclaw Nov. 24, 2018, 9:51 a.m.
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.

---

Patch

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))
 	    {