shithub: npe

Download patch

ref: e8bd74f2530f77647921e586c7f89d31f661a7f5
parent: 4434d2e57338d75f6eff1a66df77dd021691f854
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Jul 10 13:43:05 EDT 2023

realpath: resort to cleanname if could not open the file

--- a/libnpe/realpath.c
+++ b/libnpe/realpath.c
@@ -13,6 +13,9 @@
 		if(fd2path(f, p, sizeof(p)) == 0)
 			s = buffer == nil ? strdup(p) : strcpy(buffer, p);
 		close(f);
+	}else if(strlen(path) < sizeof(p)){
+		strcpy(buffer, path);
+		s = cleanname(buffer);
 	}
 
 	return s;