git://git.jankratochvil.net
/
reactos.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git]
/
lib
/
crtdll
/
direct
/
chdrive.c
1
#include <crtdll/direct.h>
2
#include <crtdll/stdlib.h>
3
#include <crtdll/ctype.h>
4
#include <windows.h>
5
6
int cur_drive = 0;
7
8
9
10
int _chdrive( int drive )
11
{
12
char d[3];
13
if (!( drive >= 1 && drive <= 26 ))
14
return -1;
15
16
if ( cur_drive != drive ) {
17
cur_drive = drive;
18
d[0] = toupper(cur_drive + '@');
19
d[1] = ':';
20
d[2] = 0;
21
SetCurrentDirectoryA(d);
22
}
23
24
25
return 0;
26
}