~micahg/ubuntu/natty/pidgin/2.7.9-2

« back to all changes in this revision

Viewing changes to pidgin/win32/untar.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-12-02 16:45:52 UTC
  • mfrom: (2.3.14 sid)
  • Revision ID: james.westby@ubuntu.com-20101202164552-z64wykojzacbb546
Tags: 1:2.7.7-1ubuntu1
New upstream version, drop msn workaround

Show diffs side-by-side

added added

removed removed

Lines of Context:
578
578
 */
579
579
int untar(const char *filename, const char* destdir, untar_opt options) {
580
580
        int ret=1;
581
 
        char curdir[_MAX_PATH];
 
581
        wchar_t curdir[_MAX_PATH];
 
582
        wchar_t *w_destdir;
582
583
        untarops = options;
583
584
        /* open the archive */
584
585
        inname = filename;
589
590
                return 0;
590
591
        }
591
592
 
 
593
        w_destdir = g_utf8_to_utf16(destdir, -1, NULL, NULL, NULL);
 
594
 
592
595
        /* Set current directory */
593
 
        if(!GetCurrentDirectory(_MAX_PATH, curdir)) {
 
596
        if(!GetCurrentDirectoryW(_MAX_PATH, curdir)) {
594
597
                untar_error("Could not get current directory (error %lu).\n", GetLastError());
595
598
                fclose(infp);
596
599
                return 0;
597
600
        }
598
 
        if(!SetCurrentDirectory(destdir)) {
 
601
        if(!SetCurrentDirectoryW(w_destdir)) {
599
602
                untar_error("Could not set current directory to (error %lu): %s\n", GetLastError(), destdir);
600
603
                fclose(infp);
601
604
                return 0;
614
617
                        fclose(outfp);
615
618
                        outfp = NULL;
616
619
                }
617
 
                if(!SetCurrentDirectory(curdir)) {
 
620
                if(!SetCurrentDirectoryW(curdir)) {
618
621
                        untar_error("Could not set current dir back to original (error %lu).\n", GetLastError());
619
622
                        ret=0;
620
623
                }
621
624
        }
622
625
 
 
626
        g_free(w_destdir);
 
627
 
623
628
        /* close the archive file. */
624
629
        fclose(infp);
625
630