Fix handling of /.filename

This commit is contained in:
Christopher Faylor 2000-04-21 14:37:48 +00:00
parent 6b762a4ec6
commit 7203adb1cc
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
Fri Apr 21 01:27:47 2000 Christopher Faylor <cgf@cygnus.com>
Fri Apr 21 10:37:08 2000 Christopher Faylor <cgf@cygnus.com>
* path.cc (normalize_posix_path): Previous two patches were still
incorrect so rewrite this function to deal with trailing dots.

View File

@ -561,7 +561,11 @@ normalize_posix_path (const char *cwd, const char *src, char *dst)
strcpy (dst, cwd);
dst = strchr (dst, '\0');
if (*src == '.')
goto sawdot;
{
if (dst == dst_start + 1)
dst--;
goto sawdot;
}
if (dst > dst_start && !isslash (dst[-1]))
*dst++ = '/';
}