* fhandler.h (fhandler_base::hclose): New virtual method.

(fhandler_base::set_inheritance): Make this a method so that we can use the
appropriate close methods.
* fhandler.cc (fhandler_base::set_inheritance): Ditto.
* path.cc (normalize_posix_path): Eliminate /.  trailing path component.
This commit is contained in:
Christopher Faylor
2000-04-20 04:38:10 +00:00
parent f06a3648d5
commit d7aac2acf5
4 changed files with 34 additions and 21 deletions

View File

@ -549,7 +549,7 @@ normalize_posix_path (const char *cwd, const char *src, char *dst)
const char *src_start = src;
char *dst_start = dst;
if (! SLASH_P (src[0]))
if (!SLASH_P (src[0]))
{
if (strlen (cwd) + 1 + strlen (src) >= MAX_PATH)
{
@ -619,6 +619,8 @@ normalize_posix_path (const char *cwd, const char *src, char *dst)
++src;
}
}
if (dst > (dst_start + 1) && dst[-1] == '.' && SLASH_P (dst[-2]))
dst -= 2;
*dst = 0;
debug_printf ("%s = normalize_posix_path (%s)", dst_start, src_start);
return 0;