From 21c82365ebca884683dc924017b791743a044ef5 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Sun, 5 Mar 2017 21:04:20 +0100 Subject: Fix: compress rar split into volumes Fixes #127 --- src/fr-process.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/fr-process.c b/src/fr-process.c index a2d8898..7a65493 100644 --- a/src/fr-process.c +++ b/src/fr-process.c @@ -689,10 +689,20 @@ start_current_command (FrProcess *process) if (g_str_has_prefix(commandline, "mv")) { - if ((i==3) && (!g_file_test(g_shell_quote(argv[2]), G_FILE_TEST_EXISTS)) && (!fixname)) { + if ((i==3) && (!g_file_test(argv[2], G_FILE_TEST_EXISTS)) && (!fixname)) { + char rarfile[strlen(argv[2])+7]; - if ((g_str_has_suffix(argv[2], ".7z")) && (!g_str_has_suffix(argv[2], ".tar.7z"))) { - commandline = g_strconcat(commandline, " ", g_shell_quote(argv[2]), "*", NULL); + strcpy(rarfile, argv[2]); + rarfile[strlen(rarfile)-3]=0; + strcat(rarfile, "part1.rar"); + + if (g_str_has_suffix(argv[2], ".7z")) { + commandline = g_strconcat(commandline, " ", g_shell_quote(argv[2]), ".*", NULL); + fixname = TRUE; + } + else if (g_str_has_suffix(argv[2], ".rar")) { + rarfile[strlen(rarfile)-5]=0; + commandline = g_strconcat(commandline, " ", g_shell_quote(rarfile), "*.rar", NULL); fixname = TRUE; } } -- cgit v1.2.1