vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 8cd7492d336548173dcb4e84e2c3b05cc48af660 parent 5cd1522408c6a53dc8a778807d37e3f29e69a4b6 Author: Marc André Tanner <mat@brain-dump.org> Date: Fri, 16 Jan 2015 10:52:39 +0100 Always close file descriptor after :read command Diffstat:
| M | vis.c | | | 3 | +-- |
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/vis.c b/vis.c @@ -1567,8 +1567,7 @@ static bool cmd_read(Filerange *range, const char *argv[]) { text_insert(vis->win->text, pos, data, info.st_size); pos += info.st_size; err: - if (fd > 2) - close(fd); + close(fd); if (data && data != MAP_FAILED) munmap(data, info.st_size); }