wimlib_global_init(): check for conflicting case sensitivity mode
authorEric Biggers <ebiggers3@gmail.com>
Tue, 28 Apr 2015 01:54:54 +0000 (20:54 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 28 Apr 2015 01:54:54 +0000 (20:54 -0500)
src/wim.c

index 6522d7b..98836a5 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -954,6 +954,13 @@ wimlib_global_init(int init_flags)
                           WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE))
                goto out;
 
+       ret = WIMLIB_ERR_INVALID_PARAM;
+       if ((init_flags & (WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE |
+                          WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE))
+                       == (WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE |
+                           WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE))
+               goto out;
+
        libxml_global_init();
        if (!(init_flags & WIMLIB_INIT_FLAG_ASSUME_UTF8)) {
                wimlib_mbs_is_utf8 = test_locale_ctype_utf8();