diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index 7d51363c0f..9f3a807af5 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -10,6 +10,11 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-03-05 11:53 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * harbour/src/rtl/fstemp.c + ! fixed hb_fsCreateTempEx() to add dir separator if necessary + % small optimization in DJGPP path conversions + 2013-03-05 11:22 UTC+0100 Tamas TEVESZ (ice extreme.hu) * src/common/hbver.c ! Open64 5.0 does not define __OPENCC_PATCHLEVEL__ to diff --git a/harbour/src/rtl/fstemp.c b/harbour/src/rtl/fstemp.c index 27a3373549..48aa232c31 100644 --- a/harbour/src/rtl/fstemp.c +++ b/harbour/src/rtl/fstemp.c @@ -138,8 +138,8 @@ static HB_BOOL fsGetTempDirByCase( char * pszName, const char * pszTempDir, HB_B { # if defined( __DJGPP__ ) /* convert '/' to '\' */ - char * pszDelim; - while( ( pszDelim = strchr( pszName, '/' ) ) != NULL ) + char * pszDelim = pszName; + while( ( pszDelim = strchr( pszDelim, '/' ) ) != NULL ) *pszDelim = '\\'; # endif if( ! hb_fsDirExists( pszTempDir ) ) @@ -161,7 +161,16 @@ HB_FHANDLE hb_fsCreateTempEx( char * pszName, const char * pszDir, const char * pszName[ 0 ] = '\0'; if( pszDir && pszDir[ 0 ] != '\0' ) + { hb_strncpy( pszName, pszDir, HB_PATH_MAX - 1 ); + iLen = ( int ) strlen( pszName ); + if( pszName[ iLen - 1 ] != HB_OS_PATH_DELIM_CHR && + iLen < HB_PATH_MAX - 1 ) + { + pszName[ iLen ] = HB_OS_PATH_DELIM_CHR; + pszName[ iLen + 1 ] = '\0'; + } + } else hb_fsTempDir( pszName ); @@ -295,8 +304,8 @@ static HB_BOOL hb_fsTempName( char * pszBuffer, const char * pszDir, const char { # if defined( __DJGPP__ ) /* convert '/' to '\' */ - char * pszDelim; - while( ( pszDelim = strchr( pTmpBuffer, '/' ) ) != NULL ) + char * pszDelim = pTmpBuffer; + while( ( pszDelim = strchr( pszDelim, '/' ) ) != NULL ) *pszDelim = '\\'; # endif hb_osStrDecode2( pTmpBuffer, pszBuffer, HB_PATH_MAX - 1 );