aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-18 17:18:40 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-18 17:37:42 +0200
commitb6d31e959a957b25aae8b75569320e0ef8af4419 (patch)
treeba941d7b1a6ffce2ee66cc2af36d9da9071f7b18
parent2c5c662851fc49a9d2d3095b2711c4b3ba752a72 (diff)
downloadvis-b6d31e959a957b25aae8b75569320e0ef8af4419.tar.gz
vis-b6d31e959a957b25aae8b75569320e0ef8af4419.tar.xz
Do only open an empty buffer if the file does not exist
Opening a file without having read permissions should fail.
-rw-r--r--editor.c2
1 files changed, 1 insertions, 1 deletions
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;