From 8ade25dfd296e6ce15bf9e00552ed69273e1a39d Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Sat, 9 Feb 2002 17:12:39 +0000 Subject: [PATCH] 2002-02-09 20:10 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 4 +++ harbour/source/vm/runner.c | 57 +++++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d0b9c28681..5ecf59c7cd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,10 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + ! Fixed problems with hb_strupr( ( hb_parc(1) ) by using hb_strdup() + * source/rdd/workarea.c + ! Fixed a bug in hb_waAddField() + 2002-02-10 16:00 UTC+0100 Antonio Linares * include/hbapi.h * source/vm/debug.c diff --git a/harbour/source/vm/runner.c b/harbour/source/vm/runner.c index a4eedfec1c..bbed50df26 100644 --- a/harbour/source/vm/runner.c +++ b/harbour/source/vm/runner.c @@ -174,10 +174,10 @@ HB_FUNC( __HRBRUN ) if( argv ) hb_xfree( argv ); hb_retl( 1 ); + hb_hrbUnLoad( pHrbBody ); } else hb_retl( 0 ); - hb_hrbUnLoad( pHrbBody ); } else hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBRUN", 0 ); @@ -199,16 +199,22 @@ HB_FUNC( __HRBDO ) { int i; char **argv = NULL; + PHRB_BODY pHrbBody = (PHRB_BODY) hb_parnl( 1 ); - if( argc > 1 ) + if( pHrbBody ) { - argv = (char**) hb_xgrab( sizeof(char*) * (argc-1) ); - for( i=0; i 1 ) + { + argv = (char**) hb_xgrab( sizeof(char*) * (argc-1) ); + for( i=0; iulSymbols ) + if( pHrbBody ) { - if( !strcmp( szName, pHrbBody->pSymRead[ ulPos ].szName ) ) - break; - ulPos++; + while( ulPos < pHrbBody->ulSymbols ) + { + if( !strcmp( szName, pHrbBody->pSymRead[ ulPos ].szName ) ) + break; + ulPos++; + } + if( ulPos < pHrbBody->ulSymbols ) + hb_retnl( (LONG) ( pHrbBody->pSymRead + ulPos ) ); + else + hb_retnl( 0 ); } - if( ulPos < pHrbBody->ulSymbols ) - hb_retnl( (LONG) ( pHrbBody->pSymRead + ulPos ) ); else - hb_retnl( 0 ); + hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBGETFU", 0 ); } else hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBGETFU", 0 ); @@ -251,13 +262,19 @@ HB_FUNC( __HRBDOFU ) if( argc >=1 ) { int i; + PHB_SYMB pSym = (PHB_SYMB) hb_parnl( 1 ); - hb_vmPushSymbol( (PHB_SYMB) hb_parnl( 1 ) ); - hb_vmPushNil(); - for( i = 0; i < argc-1; i++ ) /* Push other params */ - hb_vmPush( hb_param( i + 2, HB_IT_ANY ) ); + if( pSym ) + { + hb_vmPushSymbol( pSym ); + hb_vmPushNil(); + for( i = 0; i < argc-1; i++ ) /* Push other params */ + hb_vmPush( hb_param( i + 2, HB_IT_ANY ) ); - hb_vmSend( argc-1 ); /* Run function */ + hb_vmSend( argc-1 ); /* Run function */ + } + else + hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBDOFU", 0 ); } else hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBDOFU", 0 );