Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-11-11 08:36:34 +0300
committerChristopher Faylor <me@cgf.cx>2000-11-11 08:36:34 +0300
commit6ccb6bcf3d24550eead6c969f2ac9a5f9f5105d3 (patch)
tree52dca8cef43f7e7420b218991742ed74d7170d55 /winsup/cygwin/environ.cc
parent466ebd61d393cffdcb7eda14d5e45eab2cd10ed4 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r--winsup/cygwin/environ.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 3b67bc760..6fc59407e 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -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}}},