* fhandler.h (fhandler_cygdrive:DRVSZ): New enum.
(pdrive_buf): New place to hold information about cygdrive. * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Store drive info in pdrive_buf since get_win32_name() could now be too small to hold everything. (fhandler_cygdrive::rewinddir): Reset pdrive to pdrive_buf. (fhandler_cygdrive::closedir): Ditto. * pipe.cc (fhandler_pipe::init): Be more defensive when referencing get_win32_name(). Rework logic which made a copy of the POSIX path and then never used it.
This commit is contained in:
@@ -32,13 +32,15 @@ fhandler_pipe::fhandler_pipe ()
|
||||
int
|
||||
fhandler_pipe::init (HANDLE f, DWORD a, mode_t mode)
|
||||
{
|
||||
// FIXME: Have to clean this up someday
|
||||
if (!*get_win32_name () && get_name ())
|
||||
/* FIXME: Have to clean this up someday
|
||||
FIXME: Do we have to check for both !get_win32_name() and
|
||||
!*get_win32_name()? */
|
||||
if ((!get_win32_name () || !*get_win32_name ()) && get_name ())
|
||||
{
|
||||
char *d;
|
||||
const char *s;
|
||||
char *hold_normalized_name = (char *) alloca (strlen (get_name ()) + 1);
|
||||
strcpy (hold_normalized_name, get_name ());
|
||||
char *s, *d;
|
||||
for (s = hold_normalized_name, d = (char *) get_win32_name (); *s; s++, d++)
|
||||
for (s = get_name (), d = hold_normalized_name; *s; s++, d++)
|
||||
if (*s == '/')
|
||||
*d = '\\';
|
||||
else
|
||||
|
Reference in New Issue
Block a user