X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fextract.c;h=d4029ef61375ffe751fde3e5267fd807e2b2014d;hp=5c6c38a013ba8ee542aca292dd3a27d88bfd3cea;hb=a0a35f892af5a7536b68d3d8034bcd5f298d7de1;hpb=e322cb658a1257d3a5174301b948a4ccad7b3851 diff --git a/src/extract.c b/src/extract.c index 5c6c38a0..d4029ef6 100644 --- a/src/extract.c +++ b/src/extract.c @@ -446,6 +446,7 @@ file_name_valid(utf16lechar *name, size_t num_chars, bool fix) } } +#ifdef __WIN32__ if (name[num_chars - 1] == cpu_to_le16(' ') || name[num_chars - 1] == cpu_to_le16('.')) { @@ -454,6 +455,7 @@ file_name_valid(utf16lechar *name, size_t num_chars, bool fix) else return false; } +#endif return true; } @@ -566,12 +568,14 @@ out_replace: #endif size_t fixed_name_num_chars = tchar_nchars; tchar fixed_name[tchar_nchars + 50]; - size_t extraction_name_nbytes; tmemcpy(fixed_name, tchar_name, tchar_nchars); fixed_name_num_chars += tsprintf(fixed_name + tchar_nchars, T(" (invalid filename #%lu)"), ++args->invalid_sequence); + #ifndef __WIN32__ + FREE(tchar_name); + #endif dentry->extraction_name = memdup(fixed_name, 2 * fixed_name_num_chars + 2); if (!dentry->extraction_name) return WIMLIB_ERR_NOMEM;