Skip to content

Commit

Permalink
fix: don't replace slashes on UNIX
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur committed Nov 23, 2024
1 parent 6d45beb commit fe69d95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mz_zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,9 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil
}

if (err == MZ_OK) {
const char *backslash = NULL;
const char *next = filename;
#if defined(_WIN32)
const char *backslash = NULL;
int32_t left = filename_length;

/* Ensure all slashes are written as forward slashes according to 4.4.17.1 */
Expand All @@ -801,7 +802,7 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil
left -= part_length + 1;
next = backslash + 1;
}

#endif
if (err == MZ_OK && left > 0) {
if (mz_stream_write(stream, next, left) != left)
err = MZ_WRITE_ERROR;
Expand Down

0 comments on commit fe69d95

Please sign in to comment.