diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 728e0c88bb..6447f2f085 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-11-11 16:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/xhb/hbcompat.ch + + Added hb_At() translation to extended At() + + * contrib/tip/popcln.prg + * contrib/tip/mail.prg + ! Changed extended At() to hb_At(). + 2007-11-11 16:05 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/xhb/hbcompat.ch + Added extended At() translation to hb_At() diff --git a/harbour/contrib/tip/mail.prg b/harbour/contrib/tip/mail.prg index d3a21cd950..17e85ef381 100644 --- a/harbour/contrib/tip/mail.prg +++ b/harbour/contrib/tip/mail.prg @@ -397,7 +397,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail nPos := 1 ENDIF - nLinePos := At( e"\r\n", cMail, nPos ) + nLinePos := hb_At( e"\r\n", cMail, nPos ) DO WHILE nLinePos > nPos // going on with last field? IF (SubStr( cMail, nPos, 1 ) == " " .or. SubStr( cMail, nPos, 1 ) == e"\t" ); @@ -410,7 +410,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail ENDIF ELSE - nSplitPos := At( ":", cMail, nPos ) + nSplitPos := hb_At( ":", cMail, nPos ) cLastField := Substr( cMail, nPos, nSplitPos - nPos) cValue := Ltrim(Substr( cMail, nSplitPos +1, nLinePos - nSplitPos -1)) IF Lower(cLastField) == "received" @@ -421,9 +421,9 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail ENDIF nPos := nLinePos + 2 - nLinePos := At( e"\r\n", cMail, nPos ) + nLinePos := hb_At( e"\r\n", cMail, nPos ) //Prevents malformed body to affect us - IF cBoundary != NIL .and. At( "--"+cBoundary, cMail, nPos ) == 1 + IF cBoundary != NIL .and. hb_At( "--"+cBoundary, cMail, nPos ) == 1 RETURN 0 ENDIF ENDDO @@ -448,27 +448,27 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail nPos := nLinePos + 2 nBodyPos := nPos - nLinePos := At( e"\r\n", cMail, nPos ) + nLinePos := hb_At( e"\r\n", cMail, nPos ) DO WHILE nLinePos >= nPos // Avoid useless tests for empty lines IF nLinePos == nPos nPos += 2 - nLinePos := At( e"\r\n", cMail, nPos ) + nLinePos := hb_At( e"\r\n", cMail, nPos ) LOOP ENDIF //have we met the boundary? - IF cBoundary != NIL .and. At( "--"+cBoundary, cMail, nPos ) == nPos + IF cBoundary != NIL .and. hb_At( "--"+cBoundary, cMail, nPos ) == nPos EXIT ENDIF //Have we met a section? IF cSubBoundary != NIL .and.; - At( "--" + cSubBoundary, cMail, nPos ) == nPos + hb_At( "--" + cSubBoundary, cMail, nPos ) == nPos //is it the last subsection? - IF At( "--", cMail, nPos + Len(cSubBoundary)+2, nLinePos) > 0 + IF hb_At( "--", cMail, nPos + Len(cSubBoundary)+2, nLinePos) > 0 EXIT ENDIF @@ -497,10 +497,10 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail Instead of testing every single line of mail until we find next boundary, if there is a boundary we jump to it immediatly, this saves thousands of EOL test and makes splitting of a string fast */ - nPos := iif( ! Empty(cSubBoundary), At("--" + cSubBoundary, cMail, nPos ), iif( ! Empty(cBoundary), At("--" + cBoundary, cMail, nPos ), nLinePos + 2 )) + nPos := iif( ! Empty(cSubBoundary), hb_At("--" + cSubBoundary, cMail, nPos ), iif( ! Empty(cBoundary), hb_At("--" + cBoundary, cMail, nPos ), nLinePos + 2 )) ENDIF - nLinePos := At( e"\r\n", cMail, nPos ) + nLinePos := hb_At( e"\r\n", cMail, nPos ) ENDDO // set our body if needed diff --git a/harbour/contrib/tip/popcln.prg b/harbour/contrib/tip/popcln.prg index 8373669ae9..6066641850 100644 --- a/harbour/contrib/tip/popcln.prg +++ b/harbour/contrib/tip/popcln.prg @@ -318,7 +318,7 @@ METHOD Retrieve( nId, nLen ) CLASS tIPClientPOP otherwise if response breaks EOM in two, it will never be found */ - IF ( nPos := At( cEOM, cRet, Max( nRetLen - Len( cEOM ), 1 ) ) ) <> 0 + IF ( nPos := hb_At( cEOM, cRet, Max( nRetLen - Len( cEOM ), 1 ) ) ) <> 0 // Remove ".CRLF" cRet := Left( cRet, nPos + 1 ) ::bEof := .T. diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index f755ffadad..8382f6c0fc 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -79,6 +79,7 @@ #xtranslate hb_RAScan([]) => RAScan() #xtranslate hb_AIns([]) => AIns() #xtranslate hb_ADel([]) => ADel() + #xtranslate hb_At([]) => At() #xtranslate hb_ISPOINTER( )=> ISPOINTER( )