From de6b32af549c731191f1864df134dceee034ae16 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 10 Sep 2008 10:29:00 +0000 Subject: [PATCH] don't allow attempts to :source directories --- content/io.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/content/io.js b/content/io.js index cfb72f6a..f1dd40c7 100644 --- a/content/io.js +++ b/content/io.js @@ -679,11 +679,17 @@ lookup: { var file = ioManager.getFile(filename); - if (!file.exists()) + if (!file.exists() || !file.isReadable() || file.isDirectory()) { if (!silent) + { + if (file.isDirectory()) + liberator.echo("Cannot source a directory: \"" + filename + "\"\n"); + liberator.echoerr("E484: Can't open file " + filename); - return false; + } + + return; } var str = ioManager.readFile(filename);