reactos/reactos/lib/crtdll/direct/chdrive.c
Boudewijn Dekker e8cbdde2a7 moved some header files from top level to crtdll directory
svn path=/trunk/; revision=365
1999-04-02 21:44:11 +00:00

26 lines
371 B
C

#include <crtdll/direct.h>
#include <crtdll/stdlib.h>
#include <crtdll/ctype.h>
#include <windows.h>
int cur_drive = 0;
int _chdrive( int drive )
{
char d[3];
if (!( drive >= 1 && drive <= 26 ))
return -1;
if ( cur_drive != drive ) {
cur_drive = drive;
d[0] = toupper(cur_drive + '@');
d[1] = ':';
d[2] = 0;
SetCurrentDirectory(d);
}
return 0;
}