Changeset cec120d523341b08cdc3cba2674fb014f9e99a49

Show
Ignore:
Timestamp:
11/21/06 11:26:29 (2 years ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1164104789 +0000
git-parent:

[3d1a131f61ce2c52997128178a55f708e10ca793]

git-author:
Rafaël Carré <funman@videolan.org> 1164104789 +0000
Message:

Use only wide char functions, on win9x too
win9x testers, raise your hand

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/extras/libc.c

    r3d1a131 rcec120d  
    417417    } 
    418418 
    419     if (GetVersion() < 0x80000000) 
    420     { 
    421         /* for Windows NT and above */ 
    422         wchar_t wpath[MAX_PATH + 1]; 
    423  
    424         if (!MultiByteToWideChar (CP_UTF8, 0, psz_path, -1, wpath, MAX_PATH)) 
    425             return NULL; 
    426         wpath[MAX_PATH] = L'\0'; 
    427         p_real_dir = _wopendir( wpath ); 
    428     } 
    429     else 
    430     { 
    431         p_real_dir = opendir( psz_path );  
    432     } 
     419    wchar_t wpath[MAX_PATH + 1]; 
     420 
     421    if (!MultiByteToWideChar (CP_UTF8, 0, psz_path, -1, wpath, MAX_PATH)) 
     422        return NULL; 
     423    wpath[MAX_PATH] = L'\0'; 
     424    p_real_dir = _wopendir( wpath ); 
    433425 
    434426    if ( p_real_dir == NULL ) 
     
    460452        } 
    461453         
    462         if( GetVersion() < 0x80000000 ) 
    463             return _wreaddir( p_dir->p_real_dir ); 
    464         else 
    465             return readdir( p_dir->p_real_dir ); 
     454        return _wreaddir( p_dir->p_real_dir ); 
    466455    } 
    467456 
     
    489478    if ( p_dir->p_real_dir != NULL ) 
    490479    { 
    491         int i_ret; 
    492         if( GetVersion() < 0x80000000 ) 
    493             i_ret = _wclosedir( p_dir->p_real_dir ); 
    494         else 
    495             i_ret = closedir( p_dir->p_real_dir ); 
     480        int i_ret = _wclosedir( p_dir->p_real_dir ); 
    496481        free( p_dir ); 
    497482        return i_ret;