mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-29 18:40:25 +08:00
* path.cc (symlink): Keep relative paths relative in the DOS
path inside of a shortcut. If that's impossible or the target path is already absolute save an absolute path.
This commit is contained in:
parent
ff413a9894
commit
659b480b8a
@ -1,8 +1,8 @@
|
||||
Thu Feb 22 17:09:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* path.cc (symlink): Keep relative paths relative in the DOS
|
||||
path inside of a shortcut. If that's impossible for some
|
||||
reason, save an absolute path.
|
||||
path inside of a shortcut. If that's impossible or the target
|
||||
path is already absolute save an absolute path.
|
||||
|
||||
Thu Feb 22 15:33:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
|
@ -2209,7 +2209,7 @@ symlink (const char *topath, const char *frompath)
|
||||
strcpy (from + len, ".lnk");
|
||||
path_conv win32_path (from, PC_SYM_NOFOLLOW);
|
||||
path_conv win32_topath;
|
||||
char cwd[MAX_PATH + 1], *cp, c = 0;
|
||||
char cwd[MAX_PATH + 1], *cp = NULL, c = 0;
|
||||
char w32topath[MAX_PATH + 1];
|
||||
#endif
|
||||
|
||||
@ -2265,18 +2265,21 @@ symlink (const char *topath, const char *frompath)
|
||||
res = 0;
|
||||
}
|
||||
#else
|
||||
getcwd (cwd, MAX_PATH + 1);
|
||||
if ((cp = strrchr (from, '/')) || (cp = strrchr (from, '\\')))
|
||||
if (!isabspath (topath))
|
||||
{
|
||||
c = *cp;
|
||||
*cp = '\0';
|
||||
chdir (from);
|
||||
getcwd (cwd, MAX_PATH + 1);
|
||||
if ((cp = strrchr (from, '/')) || (cp = strrchr (from, '\\')))
|
||||
{
|
||||
c = *cp;
|
||||
*cp = '\0';
|
||||
chdir (from);
|
||||
}
|
||||
backslashify (topath, w32topath, 0);
|
||||
}
|
||||
backslashify (topath, w32topath, 0);
|
||||
if (GetFileAttributes (w32topath) == (DWORD)-1)
|
||||
if (!cp || GetFileAttributes (w32topath) == (DWORD)-1)
|
||||
{
|
||||
win32_topath.check (topath, PC_SYM_NOFOLLOW);
|
||||
if (win32_topath.error != ENOENT)
|
||||
if (!cp || win32_topath.error != ENOENT)
|
||||
strcpy (w32topath, win32_topath);
|
||||
}
|
||||
if (cp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user