From 00db53916b3570521aeb93e39a63e400957a643c Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 18 Mar 2022 21:14:09 +1000 Subject: Abort gitar if we don't find the proper name inside. --- src/sledjchisl/sledjchisl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 73a29f3..c67187b 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -2408,12 +2408,18 @@ TODO - { I("Unpacking %s", gtr); if (shellMeFail("cd %s; ionice -c3 nice -n 19 tar -xf %s >>%s", dir, gtr, gerr)) E("Failed to unpack %s!", gtr); - char *t = xmprintf("%s/%s_git%cAR", dir, name, TYPE); + char *t = xmprintf("%s/%s_git%cAR", dir, name, TYPE), *t0 = xmprintf("%s/%s", dir, gar); // Changed from _ to -, but deal with old archives. if (qfile_exist(t)) { - if (shellMeFail("mv %s %s/%s", t, dir, gar)) E("Failed to move %s!", t); + if (shellMeFail("mv %s %s", t, t0)) E("Failed to move %s!", t); } + if (!qfile_exist(t0)) + { + C("%s doesn't exist!", t0); + return; + } + free(t0); free(t); } else -- cgit v1.1