From 7bf93bff465f03ed68f3e20f557aaeede843b341 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 15 Jun 2009 13:09:53 +0000 Subject: [PATCH] 2009-06-15 15:19 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/mainstd.c * forced '\' in argv[0] instead of '/' in DJGPP builds * disabled using SHELL envvar and forced COMSPEC in system() function in DJGPP builds (it effects __run() and hb_run() .prg functions) --- harbour/ChangeLog | 6 ++++++ harbour/source/vm/mainstd.c | 30 +++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 719df0b131..a47b14561e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,12 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-15 15:19 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/mainstd.c + * forced '\' in argv[0] instead of '/' in DJGPP builds + * disabled using SHELL envvar and forced COMSPEC in system() function + in DJGPP builds (it effects __run() and hb_run() .prg functions) + 2009-06-15 14:42 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/legacyco.c * contrib/hbwin/legacy.prg diff --git a/harbour/source/vm/mainstd.c b/harbour/source/vm/mainstd.c index db482ce5d9..2e57c04e97 100644 --- a/harbour/source/vm/mainstd.c +++ b/harbour/source/vm/mainstd.c @@ -56,18 +56,12 @@ HB_EXTERN_BEGIN #if defined(__MINGW32__) int _CRT_glob = 0; -#endif +#elif defined(__DJGPP__) -int main( int argc, char * argv[] ) -{ - HB_TRACE(HB_TR_DEBUG, ("main(%d, %p)", argc, argv)); +#include - hb_cmdargInit( argc, argv ); - hb_vmInit( TRUE ); - return hb_vmQuit(); -} +int _crt0_startup_flags = _CRT0_FLAG_USE_DOS_SLASHES; -#if defined(__DJGPP__) char ** __crt0_glob_function( char * _arg ) { /* This function disables command line wildcard expansion. */ @@ -77,6 +71,24 @@ char ** __crt0_glob_function( char * _arg ) } #endif +int main( int argc, char * argv[] ) +{ + HB_TRACE(HB_TR_DEBUG, ("main(%d, %p)", argc, argv)); + +#if defined(__DJGPP__) + __system_flags = + __system_redirect | + __system_allow_long_cmds | + __system_emulate_command | + __system_handle_null_commands | + __system_emulate_chdir; +#endif + + hb_cmdargInit( argc, argv ); + hb_vmInit( TRUE ); + return hb_vmQuit(); +} + #if defined(__WATCOMC__) && ( defined(HB_OS_LINUX) || defined(HB_OS_OS2) || defined(HB_OS_WIN) ) void hb_forceLinkMainStd( void ) {} #endif