diff options
author | Christopher Faylor <me@cgf.cx> | 2002-05-03 02:43:45 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-05-03 02:43:45 +0000 |
commit | 335c87f94dc73e6d6dbe5d29d59a1c221373bcbc (patch) | |
tree | 455a126eca0454932a47cf441272bfb7154c5232 /winsup/cygwin/path.cc | |
parent | 3bb7eb449cb21012ce47b70dce789f98005c36fd (diff) | |
download | cygnal-335c87f94dc73e6d6dbe5d29d59a1c221373bcbc.tar.gz cygnal-335c87f94dc73e6d6dbe5d29d59a1c221373bcbc.tar.bz2 cygnal-335c87f94dc73e6d6dbe5d29d59a1c221373bcbc.zip |
* fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather than
path_conv name.
(fhandler_proc::open): Ditto.
* fhandler_process.cc (fhandler_process::fstat): Use fhandler name rather than
path_conv name.
(fhandler_process::open): Ditto.
* fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name rather
than path_conv name.
(fhandler_registry::open): Ditto.
* path.cc (path_conv::check): Don't copy posix path when virtual.
(mount_info::conv_to_win32_path): Don't zero string when isproc. Just derive
normal windows path.
* path.h (path_conv::clear_normalized_path): Declare new method.
* path.cc (path_conv::clear_normalized_path): Define new method.
* dtable.cc (build_fhandler_from_name): Clear normalized path when finished to
conserve space.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 54451bce8..9299c0159 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -368,10 +368,20 @@ path_conv::update_fs_info (const char* win32_path) } } -path_conv::~path_conv () +void +path_conv::clear_normalized_path () { + // not thread safe if (normalized_path) - cfree (normalized_path); + { + cfree (normalized_path); + normalized_path = NULL; + } +} + +path_conv::~path_conv () +{ + clear_normalized_path (); } /* Convert an arbitrary path SRC to a pure Win32 path, suitable for @@ -526,8 +536,6 @@ path_conv::check (const char *src, unsigned opt, fileattr = 0; } delete fh; - if (!error) - strcpy (path, path_copy); goto out; } /* devn should not be a device. If it is, then stop parsing now. */ @@ -1428,7 +1436,13 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, /* Check if the cygdrive prefix was specified. If so, just strip off the prefix and transform it into an MS-DOS path. */ MALLOC_CHECK; - if (iscygdrive (pathbuf)) + if (isproc (pathbuf)) + { + devn = fhandler_proc::get_proc_fhandler (pathbuf); + if (devn == FH_BAD) + return ENOENT; + } + else if (iscygdrive (pathbuf)) { int n = mount_table->cygdrive_len - 1; if (!pathbuf[n] || @@ -1447,14 +1461,6 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, else if (mount_table->cygdrive_len > 1) return ENOENT; } - if (isproc (pathbuf)) - { - devn = fhandler_proc::get_proc_fhandler (pathbuf); - dst[0] = '\0'; - if (devn == FH_BAD) - return ENOENT; - goto out; - } int chrooted_path_len; chrooted_path_len = 0; |