diff --git a/.gitmodules b/.gitmodules index 0e14285be0..e9c8654a5d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,10 +2,6 @@ path = openlibm url = https://github.com/JuliaMath/openlibm.git branch = master -[submodule "posix-regex"] - path = posix-regex - url = https://gitlab.redox-os.org/redox-os/posix-regex.git - branch = master [submodule "compiler-builtins"] path = compiler-builtins url = https://gitlab.redox-os.org/redox-os/compiler-builtins.git diff --git a/Cargo.lock b/Cargo.lock index 8743a44a63..643c5f839a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -373,7 +373,9 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "posix-regex" -version = "0.1.2" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66df580334caab2f744839ab1be85493d7ec731a92d6cf928008ab0b212bf3bc" [[package]] name = "proc-macro2" diff --git a/Cargo.toml b/Cargo.toml index 93f40a6e23..50e5fa97d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ cc = "1" [dependencies] bitflags = "2" cbitset = "0.2" -posix-regex = { path = "posix-regex", features = ["no_std"] } +posix-regex = { version = "0.1.4", features = ["no_std"] } # TODO: For some reason, rand_jitter hasn't been updated to use the latest rand_core rand = { version = "0.8", default-features = false, features = ["small_rng"] } diff --git a/posix-regex b/posix-regex deleted file mode 160000 index f42f21519d..0000000000 --- a/posix-regex +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f42f21519dc900a19318ea499354d09e0491540f diff --git a/src/header/regex/mod.rs b/src/header/regex/mod.rs index badd72c0cf..9c873ce3d9 100644 --- a/src/header/regex/mod.rs +++ b/src/header/regex/mod.rs @@ -46,13 +46,10 @@ pub const REG_BADRPT: c_int = 14; #[no_mangle] #[linkage = "weak"] // redefined in GIT pub unsafe extern "C" fn regcomp(out: *mut regex_t, pat: *const c_char, cflags: c_int) -> c_int { - if cflags & REG_EXTENDED == REG_EXTENDED { - return REG_ENOSYS; - } - let pat = slice::from_raw_parts(pat as *const u8, strlen(pat)); let res = PosixRegexBuilder::new(pat) .with_default_classes() + .extended(cflags & REG_EXTENDED == REG_EXTENDED) .compile_tokens(); match res { @@ -92,10 +89,6 @@ pub unsafe extern "C" fn regexec( pmatch: *mut regmatch_t, eflags: c_int, ) -> c_int { - if eflags & REG_EXTENDED == REG_EXTENDED { - return REG_ENOSYS; - } - let regex = &*regex; // Allow specifying a compiler argument to the executor and viceversa