# HG changeset patch # User Eli Zaretskii # Date 1014748896 0 # Node ID 1874239cb5bed7378a47b21aee427dd85b0e0a9d # Parent 1440b9054cb4946a4297b59b8de94b58bdc61ca2 (Fsubstitute_in_file_name): Fix the change from 2002-02-08. diff -r 1440b9054cb4 -r 1874239cb5be src/fileio.c --- a/src/fileio.c Tue Feb 26 16:51:30 2002 +0000 +++ b/src/fileio.c Tue Feb 26 18:41:36 2002 +0000 @@ -2069,7 +2069,7 @@ && *s != ':' #endif /* VMS */ ); s++); - if (s > p + 1) + if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */ { o = (unsigned char *) alloca (s - p + 1); bcopy ((char *) p, o, s - p); @@ -2080,7 +2080,7 @@ /* If we have ~/ or ~user and `user' exists, discard everything up to ~. But if `user' does not exist, leave ~user alone, it might be a literal file name. */ - if (s == p + 1 || pw) + if (IS_DIRECTORY_SEP (p[0]) || s == p + 1 || pw) { nm = p; substituted = 1;