You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let pattern = if line_regexp {format!("^{p}$")}else{ p };
259
+
formut pattern in patterns {
260
+
/// macOS version of [regcomp](regcomp) from `libc` provides additional check for empty regex. In this case, an error [REG_EMPTY](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/regcomp.3.html) will be returned.
261
+
/// Therefore, an empty pattern is replaced with ".*".
262
+
#[cfg(target_os = "macos")]
263
+
{
264
+
pattern = if pattern == ""{
265
+
String::from(".*")
266
+
}else{
267
+
pattern
268
+
};
269
+
}
270
+
pattern = if line_regexp {
271
+
format!("^{pattern}$")
272
+
}else{
273
+
pattern
274
+
};
259
275
260
276
let c_pattern = CString::new(pattern).map_err(|err| err.to_string())?;
0 commit comments