mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 04:44:20 +01:00
Validate the pattern arg to :autocmd.
This commit is contained in:
@@ -70,7 +70,16 @@ function AutoCommands() //{{{
|
||||
function (args)
|
||||
{
|
||||
let [event, regex, cmd] = args;
|
||||
let events = null;
|
||||
let events = [];
|
||||
|
||||
try
|
||||
{
|
||||
RegExp(regex);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
return void liberator.echoerr("E475: Invalid argument: " + regex);
|
||||
}
|
||||
|
||||
if (event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user