From 7db73cb4f56b194775cdf9a04e13174d93732c1a Mon Sep 17 00:00:00 2001 From: Ignacio Ortiz de Zuniga Date: Mon, 26 Jun 2000 12:34:22 +0000 Subject: [PATCH] *** empty log message *** --- harbour/source/rtl/memoline.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/harbour/source/rtl/memoline.c b/harbour/source/rtl/memoline.c index ec4c1e9d5d..188194072f 100644 --- a/harbour/source/rtl/memoline.c +++ b/harbour/source/rtl/memoline.c @@ -70,7 +70,10 @@ HB_FUNC( MEMOLINE ) case HB_CHAR_LF: ulCurLength = 0; ulLastSpace = 0; - ulLineEnd = HB_MAX( ulPos - 2, ulLineBegin ); + if ( ulPos >= 2 ) + ulLineEnd = ulPos -2; + else + ulLineEnd = ulLineBegin; ulLines++; if( ulLines < ulLineNumber ) { @@ -128,7 +131,10 @@ HB_FUNC( MEMOLINE ) if( ulLineEnd == 0 ) { ulLines++; - ulLineEnd = ulPos - 1; + if ( ulPos == 0) + ulLineEnd = 0; + else + ulLineEnd = ulPos - 1; } if( ulLineNumber == ulLines && ulLineEnd >= ulLineBegin ) @@ -143,7 +149,7 @@ HB_FUNC( MEMOLINE ) if( pszString[ ulLineBegin + ulPos ] == HB_CHAR_HT ) ulSpAdded += ( ( ULONG ) ( ulPos / ulTabLength ) * ulTabLength ) + ulTabLength - ulPos - 1; else - memcpy( ( pszLine + ulPos + ulSpAdded ), ( pszString + ulLineBegin + ulPos ), 1 ); + * ( pszLine + ulPos + ulSpAdded ) = * ( pszString + ulLineBegin + ulPos ); } hb_retclen( pszLine, ulLineLength ); @@ -151,4 +157,4 @@ HB_FUNC( MEMOLINE ) } else hb_retc( "" ); -} +} \ No newline at end of file