* dir.cc (mkdir): Check for case clash.

* environ.cc: Add extern declaration for `pcheck_case'.
        (check_case_init): New function.
        (struct parse_thing): Add "check_case" option.
        * errno.cc (_sys_nerrlist): Add text for ECASECLASH.
        (strerror): Add case branch for ECASECLASH.
        * fhandler.cc (fhandler_disk_file::open): Check for case clash.
        * path.cc: Add global variable `pcheck_case'.
        (struct symlink_info): Add member `case_clash' and method `case_check'.
        (path_prefix_p_): Call `pathnmatch' instead of `strncasematch'.
        (pathnmatch): New funtion.
        (pathmatch): Ditto.
        (path_conv::check): Add handling for case checking.
        (symlink): Check for case clash.
        (symlink_info::check): Add parameter for case checking.
        Handle case checking.
        (symlink_info::case_check): New method.
        (chdir): Don't use unconverted path if pcheck_case==PCHECK_STRICT.
        * path.h: Add extern declarations for `pathmatch' and
        `pathnmatch'.
        (enum case_checking): New enumeration type describing
        the case checking behaviour of path conversion routines.
        (class path_conv): Add member `case_clash'.
        * syscalls.cc (_link): Check for case clash.
This commit is contained in:
Corinna Vinschen
2001-04-12 21:21:37 +00:00
parent b8a8c59d33
commit 70c370d674
8 changed files with 232 additions and 49 deletions

View File

@@ -25,6 +25,13 @@ enum pathconv_arg
PC_NULLEMPTY = 0x0020
};
enum case_checking
{
PCHECK_RELAXED = 0,
PCHECK_ADJUST = 1,
PCHECK_STRICT = 2
};
#define PC_NONULLEMPTY -1
#include <sys/mount.h>
@@ -89,6 +96,8 @@ class path_conv
DWORD fileattr;
BOOL case_clash;
void check (const char *src, unsigned opt = PC_SYM_FOLLOW,
const suffix_info *suffixes = NULL) __attribute__ ((regparm(3)));
@@ -171,3 +180,6 @@ struct cwdstuff
};
extern cwdstuff cygcwd;
extern int pathmatch (const char *path1, const char *path2);
extern int pathnmatch (const char *path1, const char *path2, int len);