Browse Source

The second progress report was done 'in between' regular output of a single line which makes the lines end up reversed in the log due to the line collection. Fix this + also also do the second progress report when needed (=after the final file).

Martijn Laan 10 months ago
parent
commit
b7edf63b10

+ 9 - 6
Components/Lzma2/Util/7z/7zMain.c

@@ -918,18 +918,21 @@ int Z7_CDECL mainW(int numargs, WCHAR *args[])
             SetFileAttributesW((LPCWSTR)destPath, attrib);
             SetFileAttributesW((LPCWSTR)destPath, attrib);
           }
           }
           #endif
           #endif
+        }
+        PrintLF();
 
 
-          #ifdef REPORT_PROGRESS
-          progress += processedSize;
+        #ifdef REPORT_PROGRESS
+        progress += outSizeProcessed;
+        if (progress == progressMax)
+        {
           ReportProgress(temp, progress, progressMax, &abort);
           ReportProgress(temp, progress, progressMax, &abort);
           if (abort)
           if (abort)
           {
           {
             res = SZ_ERROR_PROGRESS;
             res = SZ_ERROR_PROGRESS;
             break;
             break;
-          } 
-          #endif
-        }
-        PrintLF();
+          }
+        } 
+        #endif
       }
       }
       ISzAlloc_Free(&allocImp, outBuffer);
       ISzAlloc_Free(&allocImp, outBuffer);
     }
     }

BIN
Projects/Src/Compression.SevenZipDecoder/7zDecode/IS7zDec.obj