diff options
Diffstat (limited to 'crates/shirabe/src/event_dispatcher')
| -rw-r--r-- | crates/shirabe/src/event_dispatcher/event_dispatcher.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs index f03f82db..6cc1670d 100644 --- a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs +++ b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs @@ -956,7 +956,13 @@ try {{ if Platform::is_windows() { path_and_args = Preg::replace_callback( php_regex!("{^\\S+}"), - |m| str_replace("/", "\\", &m[0]), + |m| { + str_replace( + "/", + "\\", + m.get(&CaptureKey::ByIndex(0)).unwrap(), + ) + }, &path_and_args, ); } @@ -985,7 +991,11 @@ try {{ path_and_args = format!( "{}{}", path_to_exec, - substr(&path_and_args, strlen(&m[0]), None) + substr( + &path_and_args, + strlen(m.get(&CaptureKey::ByIndex(0)).unwrap()), + None + ) ); } } @@ -1001,7 +1011,13 @@ try {{ if Platform::is_windows() { exec = Preg::replace_callback( php_regex!("{^\\S+}"), - |m| str_replace("/", "\\", &m[0]), + |m| { + str_replace( + "/", + "\\", + m.get(&CaptureKey::ByIndex(0)).unwrap(), + ) + }, &exec, ); } |
