vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 5f490c7b00c6e5da4f5f02658c531bb51957ef90
parent dbd080ea770386e87031b0942a8f33d0ab7a6419
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri,  9 Jan 2015 23:21:17 +0100

More useful error message when opening non regular files

Diffstat:
Mtext.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/text.c b/text.c @@ -713,7 +713,7 @@ Text *text_load(const char *filename) { if (fstat(txt->fd, &txt->info) == -1) goto out; if (!S_ISREG(txt->info.st_mode)) { - errno = EISDIR; + errno = S_ISDIR(txt->info.st_mode) ? EISDIR : ENOTSUP; goto out; } // XXX: use lseek(fd, 0, SEEK_END); instead?