summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-05-17 05:49:51 +0000
committerChristopher Faylor <me@cgf.cx>2000-05-17 05:49:51 +0000
commit6201d15e3c588fe8b8db8381c329d09745dba908 (patch)
tree526a1cbdaf73b73f123a175292d99d32a11effc3 /winsup/cygwin/path.cc
parent8c1c1f1a431d5af6b3b4d851dc9e9e5d375e9b23 (diff)
downloadcygnal-6201d15e3c588fe8b8db8381c329d09745dba908.tar.gz
cygnal-6201d15e3c588fe8b8db8381c329d09745dba908.tar.bz2
cygnal-6201d15e3c588fe8b8db8381c329d09745dba908.zip
* 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.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc19
1 files changed, 12 insertions, 7 deletions
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.