re PR d/91339 (libphobos: ftbfs when the path contains '~')
authorIain Buclaw <ibuclaw@gcc.gnu.org>
Wed, 21 Aug 2019 07:54:06 +0000 (07:54 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Wed, 21 Aug 2019 07:54:06 +0000 (07:54 +0000)
PR d/91339
d/dmd: Merge upstream dmd b37a537d3

Fixes the error: cannot find source code for runtime library file
'object.d' when the path contains '~'.

Reviewed-on: https://github.com/dlang/dmd/pull/10309

From-SVN: r274771

gcc/d/dmd/MERGE
gcc/d/dmd/root/filename.c

index cb7b6bfac7ff7ff1ccb57a05cb6cf4f5ae3b6e35..578f3fc03091a6c7b3821595f80841623b262ae5 100644 (file)
@@ -1,4 +1,4 @@
-375ed10aa7eb28755f92775ca5c5399550cd100b
+b37a537d36c2ac69afa505a3110e2328c9fc0114
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
index 6144d810fb5b6edea385c987eca530eb1ff6a767..ad6b1148c7b16e5e479fca1f808b485fd4f8b7e5 100644 (file)
@@ -110,7 +110,8 @@ Strings *FileName::splitPath(const char *path)
                     case '~':
                     {
                         char *home = getenv("HOME");
-                        if (home)
+                        // Expand ~ only if it is prefixing the rest of the path.
+                        if (!buf.offset && p[1] == '/' && home)
                             buf.writestring(home);
                         else
                             buf.writestring("~");