* path.cc (path_conv::check): Fix "tail filling" logic.
+2004-04-12 Pierre Humblet <pierre.humblet@ieee.org>
+
+ * path.cc (path_conv::check): Fix "tail filling" logic.
+
2004-04-11 Christopher Faylor <cgf@alum.bu.edu>
* cygheap.h: Replace inexplicably removed closing brace.
bool need_directory = 0;
bool saw_symlinks = 0;
int is_relpath;
- char *tail;
+ char *tail, *path_end;
#if 0
static path_conv last_path_conv;
need_directory = 1;
*--tail = '\0';
}
- char *path_end = tail;
+ path_end = tail;
/* Scan path_copy from right to left looking either for a symlink
or an actual existing file. If an existing file is found, just
normalized_path_size = 0;
else
{
- if (tail[1] != '\0')
+ if (tail < path_end && tail > path_copy + 1)
*tail = '/';
set_normalized_path (path_copy);
}