diff options
author | onefang | 2021-10-08 07:27:54 +1000 |
---|---|---|
committer | onefang | 2021-10-08 07:27:54 +1000 |
commit | addfdce6acbc21a483735b929e9cc2344622933c (patch) | |
tree | b151af750e5f0703366cbca1615fde7bd827857c | |
parent | Fix a double free. (diff) | |
download | opensim-SC-addfdce6acbc21a483735b929e9cc2344622933c.zip opensim-SC-addfdce6acbc21a483735b929e9cc2344622933c.tar.gz opensim-SC-addfdce6acbc21a483735b929e9cc2344622933c.tar.bz2 opensim-SC-addfdce6acbc21a483735b929e9cc2344622933c.tar.xz |
UNGITAR all ancient and old ones as well.
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 12 |
1 files 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 | |||
2520 | } | 2520 | } |
2521 | else | 2521 | else |
2522 | { | 2522 | { |
2523 | E("No such gitAR file - %s", gtr); | 2523 | W("No such gitAR file - %s", gtr); |
2524 | goto ungitARend; | 2524 | goto ungitARend; |
2525 | } | 2525 | } |
2526 | 2526 | ||
@@ -2534,7 +2534,8 @@ void ungitar(simData *simd, char *sim, int count, int window, int panes, int pan | |||
2534 | 2534 | ||
2535 | if (NULL != out) | 2535 | if (NULL != out) |
2536 | { | 2536 | { |
2537 | out[strlen(out) - 1] = '\0'; | 2537 | int l = strlen(out); |
2538 | out[l - 1] = '\0'; | ||
2538 | if ('\0' == out[0]) | 2539 | if ('\0' == out[0]) |
2539 | { | 2540 | { |
2540 | E("Command returned nothing - %s", cmd); | 2541 | E("Command returned nothing - %s", cmd); |
@@ -2549,7 +2550,7 @@ void ungitar(simData *simd, char *sim, int count, int window, int panes, int pan | |||
2549 | break; | 2550 | break; |
2550 | } | 2551 | } |
2551 | free(prev); | 2552 | free(prev); |
2552 | prev = xmprintf("%s/%s.tgz", scBackup, out); | 2553 | prev = xmprintf("%s/%s-%s.tgz", scBackup, simd->tab, &out[l - 24]); // Converting any old full names to new names. |
2553 | if (!qfile_exist(prev)) | 2554 | if (!qfile_exist(prev)) |
2554 | { | 2555 | { |
2555 | I("Extracting %s", prev); | 2556 | I("Extracting %s", prev); |
@@ -2728,6 +2729,11 @@ byTab has the short name as the key, simData as the value. | |||
2728 | 2729 | ||
2729 | case UNGITAR : // "ungitAR -m avatar name" "ungitAR sim name" | 2730 | case UNGITAR : // "ungitAR -m avatar name" "ungitAR sim name" |
2730 | { | 2731 | { |
2732 | char *fullName = qstrreplace("tn", simd->name, " ", "_"); | ||
2733 | // Look for ancient ones first. | ||
2734 | if (strcmp(sim, fullName) != 0) | ||
2735 | ungitar(simd, fullName, count, window, panes, pane, FLAG(m), member, last); | ||
2736 | free(fullName); | ||
2731 | ungitar(simd, sim, count, window, panes, pane, FLAG(m), member, last); | 2737 | ungitar(simd, sim, count, window, panes, pane, FLAG(m), member, last); |
2732 | break; | 2738 | break; |
2733 | } | 2739 | } |