2006-12-11 22:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/rtl/memoline.c
    ! added fix sent to me by Randy Portnoff - it's a little bit differ
      then the one Randy sent to list but this one seems to be correct.
      I never used this function in Clipper and made only very basic
      tests. I believe that Randy make better tests and this fix will
      not break some other constructions.
This commit is contained in:
Przemyslaw Czerpak
2006-12-11 21:15:16 +00:00
parent d51f2c9df5
commit 3d627021e6
2 changed files with 13 additions and 5 deletions

View File

@@ -8,6 +8,14 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2006-12-11 22:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/memoline.c
! added fix sent to me by Randy Portnoff - it's a little bit differ
then the one Randy sent to list but this one seems to be correct.
I never used this function in Clipper and made only very basic
tests. I believe that Randy make better tests and this fix will
not break some other constructions.
2006-12-11 14:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
* harbour/contrib/rdd_ads/adsfunc.c

View File

@@ -59,10 +59,10 @@ HB_FUNC( MEMOLINE )
ULONG ulLineLength = ISNUM( 2 ) ? hb_parni( 2 ) : 79;
ULONG ulLineNumber = ISNUM( 3 ) ? hb_parni( 3 ) : 1;
ULONG ulTabLength = ISNUM( 4 ) ? hb_parni( 4 ) : 4;
ULONG ulLastSpace = 0;
ULONG ulCurLength = 0;
BOOL bWordWrap = ISLOG( 5 ) ? hb_parl( 5 ) : TRUE;
ULONG ulLen = hb_parclen( 1 );
ULONG ulLastSpace = 0;
ULONG ulCurLength = 0;
ULONG ulLines = 0;
ULONG ulPos = 0;
ULONG ulLineBegin;
@@ -85,10 +85,8 @@ HB_FUNC( MEMOLINE )
while( ulPos < ulLen && ulLines < ulLineNumber )
{
switch( pszString[ ulPos ] )
{
case HB_CHAR_HT:
ulCurLength = ( ( ULONG ) ( ulCurLength / ulTabLength ) * ulTabLength ) + ulTabLength;
ulLastSpace = ulCurLength;
@@ -147,6 +145,9 @@ HB_FUNC( MEMOLINE )
if( ulLines < ulLineNumber )
{
if( ulPos < ulLen && pszString[ ulPos ] == ' ' )
ulPos++; /* Ignore a single trailing blank (same as Cl*pper) */
ulLineBegin = ulPos - ulCurLength + 1;
ulLineEnd = 0;
}
@@ -189,4 +190,3 @@ HB_FUNC( MEMOLINE )
else
hb_retc( NULL );
}