update dev300-m58
[ooovba.git] / dmake / win95 / dchdir.c
blob53432ce63967c2b680f0096aa1574e890376319b
1 /* RCS $Id: dchdir.c,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $
2 --
3 -- SYNOPSIS
4 -- Change directory.
5 --
6 -- DESCRIPTION
7 -- Under DOS change the current drive as well as the current directory.
8 --
9 -- AUTHOR
10 -- Dennis Vadura, dvadura@dmake.wticorp.com
12 -- WWW
13 -- http://dmake.wticorp.com/
15 -- COPYRIGHT
16 -- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
17 --
18 -- This program is NOT free software; you can redistribute it and/or
19 -- modify it under the terms of the Software License Agreement Provided
20 -- in the file <distribution-root>/readme/license.txt.
22 -- LOG
23 -- Use cvs log to obtain detailed change logs.
26 #if 0
27 #include <dir.h>
28 #endif
29 #include <direct.h>
30 #include "extern.h"
32 PUBLIC int
33 dchdir(path)
34 char *path;
36 int res;
38 res = chdir(path);
40 if (res != -1 && path[1] == ':') {
41 unsigned new_drive;
43 /* for WIN32 just use the _chdrive library call */
44 new_drive = (*path & ~0x20) - 'A' + 1;
45 _chdrive(new_drive);
48 return (res);