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
/
msvcrt
/
direct
/
chdrive.c
1
#include <windows.h>
2
#include <msvcrt/ctype.h>
3
#include <msvcrt/direct.h>
4
#include <msvcrt/stdlib.h>
5
6
int cur_drive = 0;
7
8
int _chdrive( int drive )
9
{
10
char d[3];
11
if (!( drive >= 1 && drive <= 26 ))
12
return -1;
13
14
if ( cur_drive != drive ) {
15
cur_drive = drive;
16
d[0] = toupper(cur_drive + '@');
17
d[1] = ':';
18
d[2] = 0;
19
SetCurrentDirectoryA(d);
20
}
21
22
return 0;
23
}