From: ibuclaw Date: Wed, 21 Aug 2019 07:54:06 +0000 (+0000) Subject: PR d/91339 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f410ae7bea0bcea123caa0195061134ef0d2096f;p=thirdparty%2Fgcc.git 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274771 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index cb7b6bfac7ff..578f3fc03091 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -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. diff --git a/gcc/d/dmd/root/filename.c b/gcc/d/dmd/root/filename.c index 6144d810fb5b..ad6b1148c7b1 100644 --- a/gcc/d/dmd/root/filename.c +++ b/gcc/d/dmd/root/filename.c @@ -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("~");