vis

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

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

commit b320316569eef63073da826889d9f76c2bacf15a
parent e8a912582bf0e03826715f9fa92db3577a9ab568
Author: Matěj Cepl <mcepl@cepl.eu>
Date:   Fri,  9 Dec 2022 15:22:03 +0100

Add dealing with error value from fchdir in text-io.c

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

diff --git a/text-io.c b/text-io.c @@ -242,7 +242,8 @@ static int mkstempat(int dirfd, char *template) { fd = mkstemp(template); err: if (cwd != -1) { - fchdir(cwd); + if (fchdir(cwd) != 0) + return -1; close(cwd); } return fd;