2009-06-15 18:39 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/rtl/fstemp.c
  * harbour/source/rtl/filesys.c
    * convert '/' to '\' in hb_fTempCreate*()/CurDir() functions in
      DJGPP builds
This commit is contained in:
Przemyslaw Czerpak
2009-06-15 16:29:58 +00:00
parent 4466f9da49
commit 69941dbb06
3 changed files with 43 additions and 10 deletions

View File

@@ -17,6 +17,12 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-06-15 18:39 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/fstemp.c
* harbour/source/rtl/filesys.c
* convert '/' to '\' in hb_fTempCreate*()/CurDir() functions in
DJGPP builds
2009-06-15 08:41 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbxbp/apig.ch
* harbour/contrib/hbxbp/gra.ch

View File

@@ -2594,6 +2594,7 @@ BYTE * hb_fsCurDir( USHORT uiDrive )
USHORT hb_fsCurDirBuff( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen )
{
USHORT uiCurDrv = uiDrive, usError;
BYTE * pbyStart;
BOOL fResult;
HB_TRACE(HB_TR_DEBUG, ("hb_fsCurDirBuff(%hu)", uiDrive));
@@ -2605,7 +2606,9 @@ USHORT hb_fsCurDirBuff( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen )
* It will allow us to add drive emulation in hb_fsCurDrv()/hb_fsChDrv()
* and hb_fsNameConv()
*/
#if !( defined(__GNUC__) && ( defined(HB_OS_OS2) || !defined(__MINGW32__) ) )
#if defined(HB_OS_WIN) || \
( !( defined(HB_OS_OS2) && defined(__GNUC__) ) && \
!defined(__MINGW32__) && defined(HAVE_POSIX_IO) )
if( uiDrive )
{
uiCurDrv = hb_fsCurDrv() + 1;
@@ -2628,13 +2631,6 @@ USHORT hb_fsCurDirBuff( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen )
hb_fsSetIOError( fResult, 0 );
hb_vmLock();
#elif defined(HAVE_POSIX_IO)
hb_vmUnlock();
fResult = ( getcwd( ( char * ) pbyBuffer, ulLen ) != NULL );
hb_fsSetIOError( fResult, 0 );
hb_vmLock();
#elif defined(__MINGW32__)
hb_vmUnlock();
@@ -2642,6 +2638,13 @@ USHORT hb_fsCurDirBuff( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen )
hb_fsSetIOError( fResult, 0 );
hb_vmLock();
#elif defined(HAVE_POSIX_IO)
hb_vmUnlock();
fResult = ( getcwd( ( char * ) pbyBuffer, ulLen ) != NULL );
hb_fsSetIOError( fResult, 0 );
hb_vmLock();
#else
fResult = FALSE;
@@ -2661,12 +2664,17 @@ USHORT hb_fsCurDirBuff( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen )
if( usError == 0 && pbyBuffer[ 0 ] )
{
BYTE * pbyStart = pbyBuffer;
/* Strip the leading drive spec, and leading backslash if there's one. */
/* NOTE: A trailing underscore is not returned on this platform,
so we don't need to strip it. [vszakats] */
#if defined(__DJGPP__)
/* convert '/' to '\' */
while( ( pbyStart = ( BYTE * ) strchr( ( char * ) pbyBuffer, '/' ) ) != NULL )
*pbyStart = '\\';
#endif
pbyStart = pbyBuffer;
ulLen = strlen( ( char * ) pbyBuffer );
#if defined(HB_OS_HAS_DRIVE_LETTER)

View File

@@ -88,6 +88,16 @@ static BOOL fsGetTempDirByCase( BYTE * pszName, const char * pszTempDir )
}
}
# if defined(__DJGPP__)
if( fOK )
{
/* convert '/' to '\' */
char * pszDelim;
while( ( pszDelim = strchr( ( char * ) pszName, '/' ) ) != NULL )
*pszDelim = '\\';
}
# endif
return fOK;
}
#endif
@@ -230,6 +240,15 @@ static BOOL hb_fsTempName( BYTE * pszBuffer, const BYTE * pszDir, const BYTE * p
pszBuffer[ 0 ] = '\0';
fResult = ( tmpnam( ( char * ) pszBuffer ) != NULL );
# if defined(__DJGPP__)
{
/* convert '/' to '\' */
char * pszDelim;
while( ( pszDelim = strchr( ( char * ) pszBuffer, '/' ) ) != NULL )
*pszDelim = '\\';
}
# endif
#endif
hb_fsSetIOError( fResult, 0 );