# HG changeset patch # User Daniel Atallah # Date 1289256695 0 # Node ID d9db23719cf903420da261e6e20a20dc6874d9d0 # Parent 4de2b3adc823cee51526479e07d104292d1b864b# Parent a4f3d21f393cf79a4ae9030e01ef14844f97ec1c merge of '148e99c7c4a60cc18826232bd8b3270cbdddc7b5' and '89847795e1c9cbdd51c942ae1e506e6060ac2235' diff -r a4f3d21f393c -r d9db23719cf9 pidgin/win32/untar.c --- a/pidgin/win32/untar.c Mon Nov 08 17:05:53 2010 +0000 +++ b/pidgin/win32/untar.c Mon Nov 08 22:51:35 2010 +0000 @@ -578,7 +578,8 @@ */ int untar(const char *filename, const char* destdir, untar_opt options) { int ret=1; - char curdir[_MAX_PATH]; + wchar_t curdir[_MAX_PATH]; + wchar_t *w_destdir; untarops = options; /* open the archive */ inname = filename; @@ -589,13 +590,15 @@ return 0; } + w_destdir = g_utf8_to_utf16(destdir, -1, NULL, NULL, NULL); + /* Set current directory */ - if(!GetCurrentDirectory(_MAX_PATH, curdir)) { + if(!GetCurrentDirectoryW(_MAX_PATH, curdir)) { untar_error("Could not get current directory (error %lu).\n", GetLastError()); fclose(infp); return 0; } - if(!SetCurrentDirectory(destdir)) { + if(!SetCurrentDirectoryW(w_destdir)) { untar_error("Could not set current directory to (error %lu): %s\n", GetLastError(), destdir); fclose(infp); return 0; @@ -614,12 +617,14 @@ fclose(outfp); outfp = NULL; } - if(!SetCurrentDirectory(curdir)) { + if(!SetCurrentDirectoryW(curdir)) { untar_error("Could not set current dir back to original (error %lu).\n", GetLastError()); ret=0; } } + g_free(w_destdir); + /* close the archive file. */ fclose(infp);