* path.cc (path_conv::check): Make sure any trailing path component is part of
potential normalized posix path.
This commit is contained in:
parent
f6b2b56722
commit
b4bb31ad55
@ -1,3 +1,8 @@
|
|||||||
|
2002-05-23 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* path.cc (path_conv::check): Make sure any trailing path component is
|
||||||
|
part of potential normalized posix path.
|
||||||
|
|
||||||
2002-05-23 Christopher Faylor <cgf@redhat.com>
|
2002-05-23 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* smallprint.c (__small_vsprintf): Implement '%o' after all these
|
* smallprint.c (__small_vsprintf): Implement '%o' after all these
|
||||||
|
@ -408,6 +408,7 @@ path_conv::check (const char *src, unsigned opt,
|
|||||||
bool need_directory = 0;
|
bool need_directory = 0;
|
||||||
bool saw_symlinks = 0;
|
bool saw_symlinks = 0;
|
||||||
int is_relpath;
|
int is_relpath;
|
||||||
|
char *tail;
|
||||||
sigframe thisframe (mainthread);
|
sigframe thisframe (mainthread);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@ -463,7 +464,7 @@ path_conv::check (const char *src, unsigned opt,
|
|||||||
if (error)
|
if (error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char *tail = strchr (path_copy, '\0'); // Point to end of copy
|
tail = strchr (path_copy, '\0'); // Point to end of copy
|
||||||
char *path_end = tail;
|
char *path_end = tail;
|
||||||
tail[1] = '\0';
|
tail[1] = '\0';
|
||||||
|
|
||||||
@ -726,8 +727,11 @@ path_conv::check (const char *src, unsigned opt,
|
|||||||
out:
|
out:
|
||||||
if (opt & PC_POSIX)
|
if (opt & PC_POSIX)
|
||||||
{
|
{
|
||||||
|
if (tail[1] != '\0')
|
||||||
|
*tail = '/';
|
||||||
normalized_path = cstrdup (path_copy);
|
normalized_path = cstrdup (path_copy);
|
||||||
debug_printf ("path_copy %s", path_copy);
|
debug_printf ("path_copy %s", path_copy);
|
||||||
|
opt ^= PC_POSIX;
|
||||||
}
|
}
|
||||||
/* Deal with Windows stupidity which considers filename\. to be valid
|
/* Deal with Windows stupidity which considers filename\. to be valid
|
||||||
even when "filename" is not a directory. */
|
even when "filename" is not a directory. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user