aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-12-06 22:36:08 +0000
committerChristopher Faylor <me@cgf.cx>2001-12-06 22:36:08 +0000
commita0c1938145bdd0e69bd464f32e66e56624977036 (patch)
tree5ff344dc317ff4f88a2452bf49674a68b32f546e /winsup
parent9acc7b9b3dfb682c3ea6ae3fae207eea5ba14931 (diff)
downloadnewlib-a0c1938145bdd0e69bd464f32e66e56624977036.zip
newlib-a0c1938145bdd0e69bd464f32e66e56624977036.tar.gz
newlib-a0c1938145bdd0e69bd464f32e66e56624977036.tar.bz2
* path.cc (path_conv::check): Don't complain if /dev/x/foo when x doesn't
exist. (mount_info::conv_to_win32_path): Keep translating when a /cygdrive is found. Don't attempt to translate to a device name when devn == FH_CYGDRIVE. (cygwin_conv_to_win32_path): Set buffer to empty on error. (cygwin_conv_to_full_win32_path): Ditto. * window.cc: Include unistd.h to verify definitions.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog12
-rw-r--r--winsup/cygwin/path.cc24
-rw-r--r--winsup/cygwin/window.cc1
3 files changed, 27 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 3437a2c..1167042 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,15 @@
+2001-12-06 Christopher Faylor <cgf@redhat.com>
+
+ * path.cc (path_conv::check): Don't complain if /dev/x/foo when x
+ doesn't exist.
+ (mount_info::conv_to_win32_path): Keep translating when a /cygdrive is
+ found. Don't attempt to translate to a device name when devn ==
+ FH_CYGDRIVE.
+ (cygwin_conv_to_win32_path): Set buffer to empty on error.
+ (cygwin_conv_to_full_win32_path): Ditto.
+
+ * window.cc: Include unistd.h to verify definitions.
+
2001-12-05 Christopher Faylor <cgf@redhat.com>
* dir.cc (opendir): Detect error return from build_fhandler_from_name.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 4938b46..a22c7ab 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -482,14 +482,16 @@ path_conv::check (const char *src, unsigned opt,
/* devn should not be a device. If it is, then stop parsing now. */
if (devn != FH_BAD)
{
- if (component)
+ if (devn != FH_CYGDRIVE)
{
- error = ENOTDIR;
- return;
+ fileattr = 0;
+ if (component)
+ {
+ error = ENOTDIR;
+ return;
+ }
}
- if (devn != FH_CYGDRIVE)
- fileattr = 0;
- else
+ else if (!component)
fileattr = !unit ? FILE_ATTRIBUTE_DIRECTORY
: GetFileAttributes (full_path);
goto out; /* Found a device. Stop parsing. */
@@ -1389,7 +1391,6 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
dst[0] = '\0';
if (mount_table->cygdrive_len > 1)
devn = FH_CYGDRIVE;
- goto out;
}
else if (cygdrive_win32_path (pathbuf, dst, unit))
{
@@ -1466,7 +1467,8 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
*flags = mi->flags;
}
- win32_device_name (src_path, dst, devn, unit);
+ if (devn != FH_CYGDRIVE)
+ win32_device_name (src_path, dst, devn, unit);
out:
MALLOC_CHECK;
@@ -3287,11 +3289,12 @@ cygwin_conv_to_win32_path (const char *path, char *win32_path)
path_conv p (path, PC_SYM_FOLLOW);
if (p.error)
{
+ win32_path[0] = '\0';
set_errno (p.error);
return -1;
}
- strcpy (win32_path, p.get_win32 ());
+ strcpy (win32_path, p);
return 0;
}
@@ -3301,11 +3304,12 @@ cygwin_conv_to_full_win32_path (const char *path, char *win32_path)
path_conv p (path, PC_SYM_FOLLOW | PC_FULL);
if (p.error)
{
+ win32_path[0] = '\0';
set_errno (p.error);
return -1;
}
- strcpy (win32_path, p.get_win32 ());
+ strcpy (win32_path, p);
return 0;
}
diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc
index dbff12b..953f603 100644
--- a/winsup/cygwin/window.cc
+++ b/winsup/cygwin/window.cc
@@ -18,6 +18,7 @@ details. */
#include <limits.h>
#include <wingdi.h>
#include <winuser.h>
+#include <unistd.h>
#include "cygerrno.h"
#include "perprocess.h"
#include "security.h"