*/
extern uint64_t xz_crc64 (const uint8_t *buf, uint64_t size, uint64_t crc);
-#endif /* _XZ_H */
\ No newline at end of file
+#endif /* _XZ_H */
* Reset the dictionary state. When in single-call mode, set up the beginning
* of the dictionary to point to the actual output buffer.
*/
-static void dict_reset(struct dictionary *dict, struct xz_buf *b) {
+static void dict_reset (struct dictionary *dict, struct xz_buf *b) {
if (DEC_IS_SINGLE (dict->mode)) {
static void reset_console_color (void) {
-#if defined (_WIN32)
+#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__)
+
+ fprintf (stderr, "\033[0m");
+
+#elif defined (_WIN32)
HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE);
SetConsoleTextAttribute (hStdError, OriginalConsoleColor);
OriginalConsoleColor = -1;
-#else
-
- fprintf (stderr, "\033[0m");
-
#endif
}
static void set_console_color (int color) {
-#if defined (_WIN32)
+#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__)
+
+ fprintf (stderr, "\033[%dm", color);
+
+#elif defined (_WIN32)
HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE);
WORD wColor;
wColor = (OriginalConsoleColor & 0xF0) + (color & 0xF);
SetConsoleTextAttribute (hStdError, wColor);
-#else
-
- fprintf (stderr, "\033[%dm", color);
-
#endif
}
if (!(ifp = fopen (ipath, "r+b"))) {
report_at (program_name, 0, REPORT_ERROR, "failed to open '%s' for reading", ipath);
+
+ xz_dec_end (s);
continue;
}
report_at (program_name, 0, REPORT_ERROR, "skipping %s", ipath);
+ xz_dec_end (s);
fclose (ifp);
+
continue;
}
report_at (program_name, 0, REPORT_ERROR, "failed to open '%s' for writing", opath);
free (opath);
+ xz_dec_end (s);
fclose (ifp);
+
continue;
}