* dcrt0.cc: New global variable `ignore_case_with_glob'.

(dll_crt0_1): Disable case-insensitive globbing before calling `main'.
* environ.cc (glob_init): New static function to set or clear
`ignore_case_with_glob'.
(known): Changed "glob" entry to call `glob_init'.
* glob.c (match): Use case-insensitive globbing if needed.
This commit is contained in:
Christopher Faylor
2000-11-11 05:36:34 +00:00
parent 466ebd61d3
commit 6ccb6bcf3d
4 changed files with 75 additions and 10 deletions

View File

@@ -27,6 +27,7 @@ details. */
#include "perprocess.h"
extern BOOL allow_glob;
extern BOOL ignore_case_with_glob;
extern BOOL allow_ntea;
extern BOOL strip_title_path;
extern DWORD chunksize;
@@ -380,6 +381,31 @@ enum settings
set_process_state,
};
/* When BUF is:
* null or empty: disables globbing
* "ignorecase": enables case-insensitive globbing
* anything else: enables case-sensitive globbing
*/
static void
glob_init (const char *buf)
{
if (!buf || !*buf)
{
allow_glob = FALSE;
ignore_case_with_glob = FALSE;
}
else if (strncasematch (buf, "ignorecase", 10))
{
allow_glob = TRUE;
ignore_case_with_glob = TRUE;
}
else
{
allow_glob = TRUE;
ignore_case_with_glob = FALSE;
}
}
/* The structure below is used to set up an array which is used to
* parse the CYGWIN environment variable or, if enabled, options from
* the registry.
@@ -409,7 +435,7 @@ struct parse_thing
{"error_start", {func: &error_start_init}, isfunc, NULL, {{0}, {0}}},
{"export", {&export_settings}, justset, NULL, {{FALSE}, {TRUE}}},
{"forkchunk", {x: &chunksize}, justset, NULL, {{8192}, {0}}},
{"glob", {&allow_glob}, justset, NULL, {{FALSE}, {TRUE}}},
{"glob", {func: &glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
{"ntea", {&allow_ntea}, justset, NULL, {{FALSE}, {TRUE}}},
{"ntsec", {&allow_ntsec}, justset, NULL, {{FALSE}, {TRUE}}},
{"reset_com", {&reset_com}, justset, NULL, {{FALSE}, {TRUE}}},