1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-13 11:05:45 +01:00

Validate the pattern arg to :autocmd.

This commit is contained in:
Doug Kearns
2009-07-11 15:45:55 +10:00
parent 76a096e36b
commit c51761e08b

View File

@@ -70,7 +70,16 @@ function AutoCommands() //{{{
function (args) function (args)
{ {
let [event, regex, cmd] = 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) if (event)
{ {