From b2a72096f3b742185b10f091bf6e9540d4d156db Mon Sep 17 00:00:00 2001 From: Maurilio Longo Date: Sat, 6 Feb 2010 11:13:06 +0000 Subject: [PATCH] 2010-02-06 12:10 UTC+0100 Maurilio Longo (maurilio.longo@libero.it) * src/rtl/fstemp.c + Added OS/2 section to hb_fsTempDir() which uses the environment variable "TEMP" to find out the temporary directory. --- harbour/ChangeLog | 30 ++++++++++++++++++------------ harbour/src/rtl/fstemp.c | 26 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e95344f93e..ca62b42e18 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,12 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-06 12:10 UTC+0100 Maurilio Longo (maurilio.longo@libero.it) + * src/rtl/fstemp.c + + Added OS/2 section to hb_fsTempDir() which uses the + environment variable "TEMP" to find out the temporary + directory. + 2010-02-05 18:34 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/hbide.prg * contrib/hbide/idefindreplace.prg @@ -24,7 +30,7 @@ 2010-02-05 17:52 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbxbp/xbpdialog.prg - ! Fixed a long-standing bug where oDlg:close slot was + ! Fixed a long-standing bug where oDlg:close slot was hiding the window instead of passing taking appropriate action when user was opting not to close the window returning .F. from this codeblock. @@ -45,28 +51,28 @@ * contrib/hbide/idemisc.prg * contrib/hbide/ideprojmanager.prg * contrib/hbide/idesaveload.prg - + + Implemented "Search" option activated via "Search" toolbar icon. - This implementation presents a dialog to select any number of - available "Projects", one "Folder", and "Opened Tabs" in any - combination". + This implementation presents a dialog to select any number of + available "Projects", one "Folder", and "Opened Tabs" in any + combination". The results are presented in within-the-dialog edit window in a nicely colored and formatted way. This editor also provides - for "Select All", "Copy", "Clear", "Print", "Find...", - "Zoom In/Out" and some more ( to be activated ) options. - These options are visible in context menu activated with + for "Select All", "Copy", "Clear", "Print", "Find...", + "Zoom In/Out" and some more ( to be activated ) options. + These options are visible in context menu activated with right-clicking inside the "Results" editor. - This implemetation also facilitates multiple instances of the + This implemetation also facilitates multiple instances of the "Search" dialogs carrying on the operation at the same time. Double-click on any line will open an edit-tab in the main editing - area, cursor will be positioned highlighted on the "Expression" + area, cursor will be positioned highlighted on the "Expression" string, keeping the focus in "Results" editor only. - Normal usage is carrying the expected actions but I must be - ignoring something important. Please test. + Normal usage is carrying the expected actions but I must be + ignoring something important. Please test. Please forward any suggessions you think will make it more useful. diff --git a/harbour/src/rtl/fstemp.c b/harbour/src/rtl/fstemp.c index 33f74b3335..6caa168a21 100644 --- a/harbour/src/rtl/fstemp.c +++ b/harbour/src/rtl/fstemp.c @@ -410,6 +410,32 @@ HB_ERRCODE hb_fsTempDir( char * pszTempDir ) HB_TCHAR_GETFROM( pszTempDir, lpDir, HB_PATH_MAX ); } } + +#elif defined( HB_OS_OS2 ) + { + char * pszTempDirEnv = hb_getenv( "TEMP" ); + + if( ! fsGetTempDirByCase( pszTempDir, pszTempDirEnv ) ) + { + pszTempDir[ 0 ] = '.'; + pszTempDir[ 1 ] = '\0'; + } + else + nResult = 0; + + if( pszTempDirEnv ) + hb_xfree( pszTempDirEnv ); + + if( pszTempDir[ 0 ] != '\0' ) + { + int len = ( int ) strlen( pszTempDir ); + if( pszTempDir[ len - 1 ] != HB_OS_PATH_DELIM_CHR ) + { + pszTempDir[ len ] = HB_OS_PATH_DELIM_CHR; + pszTempDir[ len + 1 ] = '\0'; + } + } + } #else { char szBuffer[ L_tmpnam ];