Changeset b8f4ee2e482ab89757bb0a5dde58830f38deef12

Show
Ignore:
Timestamp:
11/11/06 17:53:21 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1163264001 +0000
git-parent:

[5d7f0d7838b7cf53100411da6083b38becc95166]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1163264001 +0000
Message:

Leverage FromWide?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_filter/timeshift.c

    r5d7f0d7 rb8f4ee2  
    567567        DWORD ret = GetTempPathW (0, NULL); 
    568568        wchar_t wdir[ret + 3]; // can at least old "C:" + nul 
    569         wchar_t *pwdir = wdir, pwdir_free = NULL; 
     569        const wchar_t *pwdir = wdir; 
     570        wchar_t *pwdir_free = NULL; 
    570571 
    571572        if (GetTempPathW (ret + 1, wdir) == 0) 
     
    573574            pwdir_free = pwdir = _wgetcwd (NULL, 0); 
    574575            if (pwdir == NULL) 
    575                 wcscpy (wdir, L"C:"); 
    576         } 
    577  
    578         ret = WideCharToMultiByte (CP_UTF8, 0, pwdir, -1, NULL, 0); 
    579         char mbdir[ret]; 
    580         WideCharToMultiByte (CP_UTF8, 0, pwdir, -1, mbdir, ret); 
     576                pwdir = L"C:"; 
     577        } 
     578 
     579        psz_dir = FromWide (pwdir); 
    581580        if (pwdir_free != NULL) 
    582581            free (pwdir_free); 
    583582 
    584         /* remove last \\ if any */ 
    585         if (mbdir[strlen (mbdir) - 1] == '\\') 
    586             mbdir[strlen (mbdit) - 1] = '\0'; 
    587  
    588         psz_dir = strdup (mbdir); 
     583        /* remove trailing antislash if any */ 
     584        if (mbdir[strlen (psz_dir) - 1] == '\\') 
     585            mbdir[strlen (psz_dir) - 1] = '\0'; 
    589586#else 
    590587        psz_dir = strdup( "/tmp" );