From 6201d15e3c588fe8b8db8381c329d09745dba908 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 17 May 2000 05:49:51 +0000 Subject: * path.cc (mount_info::cygdrive_posix_path): Don't add trailing slash if referring to something like c:\. * dcrt0.cc (dll_crt0_1): Move uinfo initialization prior to sig_send initialization to give signal thread a chance to finish. * debug.cc (WFSO): Move to sigproc.cc (WFMO): Ditto. * exceptions.cc (interruptible): Allocate slightly more space for directory just for paranoia's sake. (call_handler): Eliminate nonmain argument. Determine if main thread has set a frame pointer and use it if so. (sig_handle): Eliminate nonmain argument. * net.cc: Record frame information in appropriate routines throughout. * select.cc (select): Ditto. * sigproc.cc: Use sigthread structure to record mainthread id throughout. (sig_send): Record frame information for signal handler. (wait_sig): Reflect argument change in sig_handle. (WFSO): Move here and record frame information for signal handler. (WFMO): Ditto. * sigproc.h: Implement new "sigthread" class. Implement "sigframe" class for manipulating signal frame info. * thread.cc (__pthread_kill): Use standard _kill() function rather than calling sig_send directly. * winsup.h: Eliminate ebp element from signal_dispatch class. --- winsup/cygwin/path.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 42170aa16..0251c9004 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1101,7 +1101,7 @@ mount_info::cygdrive_posix_path (const char *src, char *dst, int trailing_slash_ The cygdrive prefix always ends with a trailing slash so the drive letter is added after the path. */ dst[len++] = tolower (src[0]); - if (!src[2]) + if (!src[2] || (SLASH_P (src[2]) && !src[3])) dst[len++] = '\000'; else { @@ -1136,11 +1136,17 @@ mount_info::conv_to_posix_path (const char *src_path, char *posix_path, int keep_rel_p) { int src_path_len = strlen (src_path); - int trailing_slash_p = (src_path_len > 0 - && SLASH_P (src_path[src_path_len - 1])); - int relative_path_p = (! SLASH_P (*src_path) - && strchr (src_path, ':') == NULL); + int relative_path_p = !isabspath (src_path); + int trailing_slash_p; + if (src_path_len <= 1) + trailing_slash_p = 0; + else + { + const char *lastchar = src_path + src_path_len - 1; + trailing_slash_p = SLASH_P (*lastchar) && lastchar[-1] != ':'; + } + debug_printf ("conv_to_posix_path (%s, %s)", src_path, keep_rel_p ? "keep-rel" : "no-keep-rel"); MALLOC_CHECK; @@ -1212,8 +1218,7 @@ mount_info::conv_to_posix_path (const char *src_path, char *posix_path, caller must want an absolute path (otherwise we would have returned above). So we always return an absolute path at this point. */ if ((isalpha (pathbuf[0])) && (pathbuf[1] == ':')) - cygdrive_posix_path (pathbuf, posix_path, trailing_slash_p && - pathbuflen > 3); + cygdrive_posix_path (pathbuf, posix_path, trailing_slash_p); else { /* The use of src_path and not pathbuf here is intentional. -- cgit v1.2.3