From df7e8e09a1fa944b6d3ef4a26aa0a7a706264436 Mon Sep 17 00:00:00 2001 From: Maurilio Longo Date: Thu, 18 Feb 2010 17:47:54 +0000 Subject: [PATCH] 2010-02-18 18:45 UTC+0100 Maurilio Longo (maurilio.longo@libero.it) * src/vm/cmdarg.c ! fixed OS/2 was displaying the path of the first .exe with name equal to current process calling hb_DirBase() present in PATH, in my case it was founding d:\tcpip\bin\ftpd.exe instead of current ftpd.exe because c:\tcpip\bin was present in PATH before current dir. * src/rtl/hbsocket.c * OS/2 when building against latest TCP/IP stack has HB_HAS_INET_ATON, HB_HAS_INET_PTON and HB_HAS_INET_NTOP --- harbour/ChangeLog | 10 ++++++++++ harbour/src/rtl/hbsocket.c | 8 +++++++- harbour/src/vm/cmdarg.c | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2a4d9a4dc9..98aff477a2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-18 18:45 UTC+0100 Maurilio Longo (maurilio.longo@libero.it) + * src/vm/cmdarg.c + ! fixed OS/2 was displaying the path of the first .exe with name equal + to current process calling hb_DirBase() present in PATH, in my case + it was founding d:\tcpip\bin\ftpd.exe instead of current ftpd.exe + because c:\tcpip\bin was present in PATH before current dir. + * src/rtl/hbsocket.c + * OS/2 when building against latest TCP/IP stack has + HB_HAS_INET_ATON, HB_HAS_INET_PTON and HB_HAS_INET_NTOP + 2010-02-18 16:59 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg * config/wce/mingwarm.mk diff --git a/harbour/src/rtl/hbsocket.c b/harbour/src/rtl/hbsocket.c index 5dd8fb5623..d879d12e26 100644 --- a/harbour/src/rtl/hbsocket.c +++ b/harbour/src/rtl/hbsocket.c @@ -150,7 +150,11 @@ # define HB_HAS_INET_PTON # define HB_HAS_INET_NTOP # else - /* test shows that GCC 3.3.6 does not support inet_pton() and inet_ntop() */ +# if ! defined( TCPV40HDRS ) +# define HB_HAS_INET_ATON +# define HB_HAS_INET_PTON +# define HB_HAS_INET_NTOP +# endif # endif #elif defined( HB_OS_DOS ) # define HB_HAS_INET_ATON @@ -179,8 +183,10 @@ # include # include # endif +# include # include # include +# include # endif # if !( defined( HB_OS_DOS ) && defined( __WATCOMC__ ) ) # include diff --git a/harbour/src/vm/cmdarg.c b/harbour/src/vm/cmdarg.c index 790f078e81..0ea203fd25 100644 --- a/harbour/src/vm/cmdarg.c +++ b/harbour/src/vm/cmdarg.c @@ -50,6 +50,10 @@ * */ +#define INCL_DOSPROCESS +#define INCL_DOSERRORS +#define INCL_DOSMODULEMGR + #include "hbapi.h" #include "hbapiitm.h" #include "hbapifs.h" @@ -58,6 +62,10 @@ #include "hbstack.h" #include "hbverbld.h" +#if defined( HB_OS_OS2 ) + #include +#endif + /* Command line argument management */ static int s_argc = 0; static char ** s_argv = NULL; @@ -146,6 +154,20 @@ void hb_cmdargUpdate( void ) HB_TCHAR_GETFROM( s_szAppName, s_lpAppName, HB_SIZEOFARRAY( s_lpAppName ) ); s_argv[ 0 ] = s_szAppName; } + +#elif defined( HB_OS_OS2 ) + PPIB ppib = NULL; + APIRET ulrc; + + ulrc = DosGetInfoBlocks( NULL, &ppib ); + if ( ulrc == NO_ERROR ) { + ulrc = DosQueryModuleName( ppib->pib_hmte, + HB_SIZEOFARRAY( s_szAppName ), + s_szAppName ); + if ( ulrc == NO_ERROR ) { + s_argv[ 0 ] = s_szAppName; + } + } #else /* NOTE: try to create absolute path from s_argv[ 0 ] if necessary */ {