* path.cc (path::check): Detect trailing slash before converting to windows
path. Tell symlink_info::check to check for directory if one is found.
(symlink_info::check): Set errno when path is not a directory if pflags &
PATH_NEEDDIR.
+Mon Sep 18 23:17:19 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * path.h: Create new input path flag PATH_NEEDDIR.
+ * path.cc (path::check): Detect trailing slash before converting to
+ windows path. Tell symlink_info::check to check for directory if one is
+ found.
+ (symlink_info::check): Set errno when path is not a directory if
+ pflags & PATH_NEEDDIR.
+
Mon Sep 18 19:44:08 2000 Christopher Faylor <cgf@cygnus.com>
* fhandler_tty.cc (fhandler_tty_slave::write): Correct typo which
Mon Sep 18 19:44:08 2000 Christopher Faylor <cgf@cygnus.com>
* fhandler_tty.cc (fhandler_tty_slave::write): Correct typo which
+ DWORD need_directory = 0;
+ char *p = strrchr (src, '/');
+ if (p)
+ {
+ if (strcmp (p, "/") == 0 || strcmp (p, "/.") == 0)
+ need_directory = PATH_NEEDDIR;
+ }
+ else if ((p = strrchr (src, '\\')) &&
+ (strcmp (p, "\\") == 0 || strcmp (p, "\\.") == 0))
+ need_directory = PATH_NEEDDIR;
/* Must look up path in mount table, etc. */
error = cygwin_shared->mount.conv_to_win32_path (src, rel_path,
full_path,
/* Must look up path in mount table, etc. */
error = cygwin_shared->mount.conv_to_win32_path (src, rel_path,
full_path,
- sym.pflags = path_flags;
+ sym.pflags = path_flags | need_directory;
}
int len = sym.check (path_copy, suff);
}
int len = sym.check (path_copy, suff);
}
/* Copy tail of full_path to discovered symlink. */
}
/* Copy tail of full_path to discovered symlink. */
for (p = sym.contents + buflen; *tail; tail++)
*p++ = *tail == '\\' ? '/' : *tail;
*p = '\0';
for (p = sym.contents + buflen; *tail; tail++)
*p++ = *tail == '\\' ? '/' : *tail;
*p = '\0';
HANDLE h;
int res = 0;
char extbuf[MAX_PATH + 5];
HANDLE h;
int res = 0;
char extbuf[MAX_PATH + 5];
const char *path = in_path;
if (!suffixes)
const char *path = in_path;
if (!suffixes)
is_symlink = TRUE;
error = 0;
is_symlink = TRUE;
error = 0;
+ if (!(pflags & PATH_NEEDDIR))
+ needdir = 0;
+ else
+ {
+ pflags &= ~PATH_NEEDDIR;
+ needdir = 1;
+ }
do
{
if (!next_suffix (ext_here, suffixes))
do
{
if (!next_suffix (ext_here, suffixes))
char *p = strrchr (path, '\\');
if (p && !(fileattr & FILE_ATTRIBUTE_DIRECTORY) &&
char *p = strrchr (path, '\\');
if (p && !(fileattr & FILE_ATTRIBUTE_DIRECTORY) &&
- (*++p == '\0' || (*p == '.' && (*++p == '\0' || (*p == '.' && p[1] == '\0')))))
+ (needdir || *++p == '\0' ||
+ (*p == '.' && (*++p == '\0' || (*p == '.' && p[1] == '\0')))))
{
debug_printf ("%s is a non-directory", path);
error = ENOTDIR;
{
debug_printf ("%s is a non-directory", path);
error = ENOTDIR;
PATH_BINARY = MOUNT_BINARY,
PATH_EXEC = MOUNT_EXEC,
PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC,
PATH_BINARY = MOUNT_BINARY,
PATH_EXEC = MOUNT_EXEC,
PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC,
+ PATH_NEEDDIR = 0x20000000,
PATH_SOCKET = 0x40000000,
PATH_HASACLS = 0x80000000
};
PATH_SOCKET = 0x40000000,
PATH_HASACLS = 0x80000000
};