vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit e5ae6cf52849f539779e8b068b186b72c4ef3a18 parent 0d2ae6733ddfeb56f6e8117fc81c0c3c0f3b5400 Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 18 Sep 2014 17:18:40 +0200 Do only open an empty buffer if the file does not exist Opening a file without having read permissions should fail. Diffstat:
| M | editor.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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;