From b6d31e959a957b25aae8b75569320e0ef8af4419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 18 Sep 2014 17:18:40 +0200 Subject: Do only open an empty buffer if the file does not exist Opening a file without having read permissions should fail. --- editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor.c b/editor.c index 967bcfa..c56aec4 100644 --- a/editor.c +++ b/editor.c @@ -323,7 +323,7 @@ bool editor_window_new(Editor *ed, const char *filename) { if (original) text = original->text; else - text = text_load(filename && access(filename, R_OK) == 0 ? filename : NULL); + text = text_load(filename && access(filename, F_OK) == 0 ? filename : NULL); if (!text) return false; -- cgit v1.2.3