:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / lib / msvcrt / direct / chdir.c
1 #include <windows.h>
2 #include <msvcrt/ctype.h>
3 #include <msvcrt/direct.h>
4
5
6 int _chdir( const char *_path )
7 {
8         if ( _path[1] == ':')
9                 _chdrive(tolower(_path[0] - 'a')+1);
10         if ( !SetCurrentDirectoryA((char *)_path) )
11                 return -1;
12
13         return 0;
14 }
15
16 int _wchdir( const wchar_t *_path )
17 {
18         if ( _path[1] == L':')
19                 _chdrive(towlower(_path[0] - L'a')+1);
20         if ( !SetCurrentDirectoryW((wchar_t *)_path) )
21                 return -1;
22
23         return 0;
24 }