From 20703a428c753bf79c07779b1b01b5bdcf73c042 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (in GitKraken)" <rob@synchro.net>
Date: Mon, 13 Mar 2023 17:51:53 -0700
Subject: [PATCH] If delfiles() is called with a NULL spec, assume "all files"
 (*)

---
 src/xpdev/dirwrap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/xpdev/dirwrap.c b/src/xpdev/dirwrap.c
index 5e7ecbcc73..5f1626eb0d 100644
--- a/src/xpdev/dirwrap.c
+++ b/src/xpdev/dirwrap.c
@@ -785,6 +785,8 @@ int delfiles(const char *inpath, const char *spec, size_t keep)
 		lastch=0;
 	else
 		lastch=inpath[inpath_len-1];
+	if(spec == NULL)
+		spec = ALLFILES;
 	path=(char *)malloc(inpath_len+1/*Delim*/+strlen(spec)+1/*Terminator*/);
 	if(path==NULL)
 		return -1;
-- 
GitLab