summaryrefslogtreecommitdiff
path: root/ext/mysql/libmysql/my_getwd.c
diff options
context:
space:
mode:
authorZak Greant <zak@php.net>2002-06-07 15:07:55 +0000
committerZak Greant <zak@php.net>2002-06-07 15:07:55 +0000
commit9daec6d2278fb671f486100faecbbbc5a42cb863 (patch)
tree671ce507dddd5a6f28d3fc9facba1d11fa3e6426 /ext/mysql/libmysql/my_getwd.c
parentfcd6d2b5cda9fc9ef582771b750c93ba09494828 (diff)
downloadphp-git-9daec6d2278fb671f486100faecbbbc5a42cb863.tar.gz
Updating embedded libmysql to version 3.23.48
Diffstat (limited to 'ext/mysql/libmysql/my_getwd.c')
-rw-r--r--ext/mysql/libmysql/my_getwd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/mysql/libmysql/my_getwd.c b/ext/mysql/libmysql/my_getwd.c
index 9e87c4d201..9b5869e8f0 100644
--- a/ext/mysql/libmysql/my_getwd.c
+++ b/ext/mysql/libmysql/my_getwd.c
@@ -14,6 +14,9 @@ This file is public domain and comes with NO WARRANTY of any kind */
#include <dos.h>
#include <direct.h>
#endif
+#if defined(OS2)
+#include <direct.h>
+#endif
#ifdef __EMX__
// chdir2 support also drive change
@@ -79,16 +82,16 @@ int my_setwd(const char *dir, myf MyFlags)
int res;
size_s length;
my_string start,pos;
-#if defined(VMS) || defined(MSDOS)
+#if defined(VMS) || defined(MSDOS) || defined(OS2)
char buff[FN_REFLEN];
#endif
DBUG_ENTER("my_setwd");
DBUG_PRINT("my",("dir: '%s' MyFlags %d", dir, MyFlags));
start=(my_string) dir;
-#if defined(MSDOS) /* MSDOS chdir can't change drive */
+#if defined(MSDOS) || defined(OS2) /* OS2/MSDOS chdir can't change drive */
#if !defined(_DDL) && !defined(WIN32)
- if ((pos=strchr(dir,FN_DEVCHAR)) != 0)
+ if ((pos=(char*) strchr(dir,FN_DEVCHAR)) != 0)
{
uint drive,drives;
@@ -96,8 +99,13 @@ int my_setwd(const char *dir, myf MyFlags)
drive=(uint) (toupper(dir[0])-'A'+1); drives= (uint) -1;
if ((pos-(byte*) dir) == 2 && drive > 0 && drive < 32)
{
+#ifdef OS2
+ _chdrive(drive);
+ drives = _getdrive();
+#else
_dos_setdrive(drive,&drives);
_dos_getdrive(&drives);
+#endif
}
if (drive != drives)
{