* path.cc (slash_drive_prefix_p): Remove.

(mount_info::slash_drive_to_win32_path): Ditto.
(mount_info::conv_to_win32_path): Remove slash drive prefix check.
(mount_info::add_item): Ditto.
(mount_info::del_item): Ditto.
* shared_info.h (mount_info): Remove slash_drive_to_win32_path declaration.
This commit is contained in:
Christopher Faylor 2001-05-25 03:13:14 +00:00
parent 3ed3570b68
commit 86f41a0954
3 changed files with 20 additions and 45 deletions

View File

@ -1,3 +1,13 @@
Thu May 24 15:46:50 2001 Christopher Faylor <cgf@cygnus.com>
* path.cc (slash_drive_prefix_p): Remove.
(mount_info::slash_drive_to_win32_path): Ditto.
(mount_info::conv_to_win32_path): Remove slash drive prefix check.
(mount_info::add_item): Ditto.
(mount_info::del_item): Ditto.
* shared_info.h (mount_info): Remove slash_drive_to_win32_path
declaration.
Thu May 24 01:17:33 2001 Christopher Faylor <cgf@cygnus.com> Thu May 24 01:17:33 2001 Christopher Faylor <cgf@cygnus.com>
* exceptions.cc (handle_exceptions): Bump repeat count for debugging * exceptions.cc (handle_exceptions): Bump repeat count for debugging

View File

@ -1038,18 +1038,6 @@ nofinalslash (const char *src, char *dst)
dst[len] = '\0'; dst[len] = '\0';
} }
/* slash_drive_prefix_p: Return non-zero if PATH begins with
//<letter>. */
static int
slash_drive_prefix_p (const char *path)
{
return (isdirsep(path[0])
&& isdirsep(path[1])
&& isalpha (path[2])
&& (path[3] == 0 || path[3] == '/'));
}
/* slash_unc_prefix_p: Return non-zero if PATH begins with //UNC/SHARE */ /* slash_unc_prefix_p: Return non-zero if PATH begins with //UNC/SHARE */
int __stdcall int __stdcall
@ -1254,10 +1242,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
if (i >= nmounts) if (i >= nmounts)
{ {
if (slash_drive_prefix_p (pathbuf)) backslashify (pathbuf, dst, 0); /* just convert */
slash_drive_to_win32_path (pathbuf, dst, 0);
else
backslashify (pathbuf, dst, 0); /* just convert */
*flags = 0; *flags = 0;
} }
else else
@ -1280,20 +1265,6 @@ out:
return 0; return 0;
} }
/* Convert PATH (for which slash_drive_prefix_p returns 1) to WIN32 form. */
void
mount_info::slash_drive_to_win32_path (const char *path, char *buf,
int trailing_slash_p)
{
buf[0] = path[2];
buf[1] = ':';
if (path[3] == '0')
strcpy (buf + 2, "\\");
else
backslashify (path + 3, buf + 2, trailing_slash_p);
}
/* cygdrive_posix_path: Build POSIX path used as the /* cygdrive_posix_path: Build POSIX path used as the
mount point for cygdrives created when there is no other way to mount point for cygdrives created when there is no other way to
obtain a POSIX path from a Win32 one. */ obtain a POSIX path from a Win32 one. */
@ -1920,10 +1891,7 @@ mount_info::add_item (const char *native, const char *posix, unsigned mountflags
char nativetmp[MAX_PATH]; char nativetmp[MAX_PATH];
char posixtmp[MAX_PATH]; char posixtmp[MAX_PATH];
if (slash_drive_prefix_p (native)) backslashify (native, nativetmp, 0);
slash_drive_to_win32_path (native, nativetmp, 0);
else
backslashify (native, nativetmp, 0);
nofinalslash (nativetmp, nativetmp); nofinalslash (nativetmp, nativetmp);
slashify (posix, posixtmp, 0); slashify (posix, posixtmp, 0);
@ -1990,10 +1958,8 @@ mount_info::del_item (const char *path, unsigned flags, int reg_p)
return -1; return -1;
} }
if (slash_drive_prefix_p (path)) if (slash_unc_prefix_p (path) || strpbrk (path, ":\\"))
slash_drive_to_win32_path (path, pathtmp, 0); backslashify (path, pathtmp, 0);
else if (slash_unc_prefix_p (path) || strpbrk (path, ":\\"))
backslashify (path, pathtmp, 0);
else else
{ {
slashify (path, pathtmp, 0); slashify (path, pathtmp, 0);

View File

@ -14,7 +14,7 @@ details. */
class mount_item class mount_item
{ {
public: public:
/* FIXME: Nasty static allocation. Need to have a heap in the shared /* FIXME: Nasty static allocation. Need to have a heap in the shared
area [with the user being able to configure at runtime the max size]. */ area [with the user being able to configure at runtime the max size]. */
@ -45,7 +45,7 @@ public:
class reg_key; class reg_key;
class mount_info class mount_info
{ {
public: public:
DWORD version; DWORD version;
DWORD sys_mount_table_counter; DWORD sys_mount_table_counter;
int nmounts; int nmounts;
@ -57,11 +57,11 @@ public:
char cygdrive[MAX_PATH]; char cygdrive[MAX_PATH];
size_t cygdrive_len; size_t cygdrive_len;
unsigned cygdrive_flags; unsigned cygdrive_flags;
private: private:
int posix_sorted[MAX_MOUNTS]; int posix_sorted[MAX_MOUNTS];
int native_sorted[MAX_MOUNTS]; int native_sorted[MAX_MOUNTS];
public: public:
/* Increment when setting up a reg_key if mounts area had to be /* Increment when setting up a reg_key if mounts area had to be
created so we know when we need to import old mount tables. */ created so we know when we need to import old mount tables. */
int had_to_create_mount_areas; int had_to_create_mount_areas;
@ -89,7 +89,7 @@ public:
void import_v1_mounts (); void import_v1_mounts ();
private: private:
void sort (); void sort ();
void read_mounts (reg_key& r); void read_mounts (reg_key& r);
@ -99,7 +99,6 @@ private:
int cygdrive_win32_path (const char *src, char *dst, int trailing_slash_p); int cygdrive_win32_path (const char *src, char *dst, int trailing_slash_p);
void cygdrive_posix_path (const char *src, char *dst, int trailing_slash_p); void cygdrive_posix_path (const char *src, char *dst, int trailing_slash_p);
void slash_drive_to_win32_path (const char *path, char *buf, int trailing_slash_p);
void read_cygdrive_info_from_registry (); void read_cygdrive_info_from_registry ();
}; };
@ -132,7 +131,7 @@ public:
class shared_info class shared_info
{ {
DWORD inited; DWORD inited;
public: public:
int heap_chunk_in_mb; int heap_chunk_in_mb;
DWORD sys_mount_table_counter; DWORD sys_mount_table_counter;