From addfdce6acbc21a483735b929e9cc2344622933c Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 8 Oct 2021 07:27:54 +1000 Subject: UNGITAR all ancient and old ones as well. --- src/sledjchisl/sledjchisl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index d4320fb..2935d83 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -2520,7 +2520,7 @@ void ungitar(simData *simd, char *sim, int count, int window, int panes, int pan } else { - E("No such gitAR file - %s", gtr); + W("No such gitAR file - %s", gtr); goto ungitARend; } @@ -2534,7 +2534,8 @@ void ungitar(simData *simd, char *sim, int count, int window, int panes, int pan if (NULL != out) { - out[strlen(out) - 1] = '\0'; + int l = strlen(out); + out[l - 1] = '\0'; if ('\0' == out[0]) { E("Command returned nothing - %s", cmd); @@ -2549,7 +2550,7 @@ void ungitar(simData *simd, char *sim, int count, int window, int panes, int pan break; } free(prev); - prev = xmprintf("%s/%s.tgz", scBackup, out); + prev = xmprintf("%s/%s-%s.tgz", scBackup, simd->tab, &out[l - 24]); // Converting any old full names to new names. if (!qfile_exist(prev)) { I("Extracting %s", prev); @@ -2728,6 +2729,11 @@ byTab has the short name as the key, simData as the value. case UNGITAR : // "ungitAR -m avatar name" "ungitAR sim name" { + char *fullName = qstrreplace("tn", simd->name, " ", "_"); + // Look for ancient ones first. + if (strcmp(sim, fullName) != 0) + ungitar(simd, fullName, count, window, panes, pane, FLAG(m), member, last); + free(fullName); ungitar(simd, sim, count, window, panes, pane, FLAG(m), member, last); break; } -- cgit v1.1