shithub: npe

Download patch

ref: 989775c21c262c29a9a717f628f2cf8ea701806a
parent: fce29312cd3c8240c39e1e7915ef7d6c1e334a7c
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Jul 10 13:20:28 EDT 2023

realpath: fix the wrong (inverted) check

--- a/libnpe/realpath.c
+++ b/libnpe/realpath.c
@@ -9,7 +9,7 @@
 	int f;
 
 	s = nil;
-	if((f = open(path, OREAD)) < 0){
+	if((f = open(path, OREAD)) >= 0){
 		if(fd2path(f, p, sizeof(p)) == 0)
 			s = buffer == nil ? strdup(p) : strcpy(buffer, p);
 		close(f);