2003-09-29 22:10 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
This commit is contained in:
@@ -8,6 +8,12 @@
|
||||
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2003-09-29 22:10 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
*source/rtl/strcase.c
|
||||
! hb_strncpyUpperTrim() is fixed ( borrowed from xHarbour ).
|
||||
* include/hbver.h
|
||||
* Release info has been corrected again ...
|
||||
|
||||
2003-09-29 15:20 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
*source/rtl/strcase.c
|
||||
! hb_strncpyUpper() is fixed ( borrowed from xHarbour ).
|
||||
|
||||
@@ -126,22 +126,36 @@ char * hb_strncpyUpper( char * pDest, const char * pSource, ULONG ulLen )
|
||||
*/
|
||||
char * hb_strncpyUpperTrim( char * pDest, const char * pSource, ULONG ulLen )
|
||||
{
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_strncpyUpper(%p, %s, %lu)", pDest, pSource, ulLen));
|
||||
char *pBuf = pDest;
|
||||
LONG ulSLen = strlen( pSource );
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_strncpyUpperTrim(%p, %s, %lu)", pDest, pSource, ulLen));
|
||||
|
||||
pDest[ ulLen ] ='\0';
|
||||
|
||||
while( ulLen-- && pSource[ ulLen ] == ' ')
|
||||
pDest[ ulLen ] = '\0';
|
||||
|
||||
ulLen++;
|
||||
while( ulLen-- )
|
||||
while( ulSLen && pSource[ ulSLen - 1 ] == ' ')
|
||||
{
|
||||
/* some compilers impliment toupper as a macro, and this has side effects! */
|
||||
/* *pDest++ = toupper( *pSource++ ); */
|
||||
pDest[ ulLen ] = toupper( (unsigned char) pSource[ ulLen ] );
|
||||
ulSLen--;
|
||||
}
|
||||
|
||||
return pDest;
|
||||
/* some compilers impliment toupper as a macro, and this has side effects! */
|
||||
/* *pDest++ = toupper( *pSource++ ); */
|
||||
while( ulLen && ulSLen && (*pDest++ = toupper( *pSource )))
|
||||
{
|
||||
ulSLen--;
|
||||
ulLen--;
|
||||
pSource++;
|
||||
}
|
||||
|
||||
if( ulLen )
|
||||
{
|
||||
while (--ulLen)
|
||||
{
|
||||
*pDest++ = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
return pBuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user