2007-05-11 10:17 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* harbour/source/rtl/filehb.c
* Changed one old TOFIX to a NOTE regarding a minor
incompatibility in FILE() where the filename is RTrim()-ed
in Clipper but not in Harbour. It became a NOTE because
making it compatible would mean losing some portability.
* harbour/source/rtl/hbffind.c
! Removed code in UNIX branch which would change an empty
file mask to "*" (thus causing FILE("") to return .T.
and DIRECTORY("") to return the whole dir content.)
! Made sure in UNIX branch that an empty file mask won't
return any files regardless of the filename matching
method used.
* harbour/source/rtl/strmatch.c
+ Added NOTE about hb_WildMatch() / sx_WildMatch()
incompatibility.
! Guarded WILDMATCH() with HB_COMPAT_XHB.
* WILDMATCH() now calls HB_WILDMATCH() internally.
This commit is contained in:
@@ -8,6 +8,27 @@
|
||||
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2007-05-11 10:17 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* harbour/source/rtl/filehb.c
|
||||
* Changed one old TOFIX to a NOTE regarding a minor
|
||||
incompatibility in FILE() where the filename is RTrim()-ed
|
||||
in Clipper but not in Harbour. It became a NOTE because
|
||||
making it compatible would mean losing some portability.
|
||||
|
||||
* harbour/source/rtl/hbffind.c
|
||||
! Removed code in UNIX branch which would change an empty
|
||||
file mask to "*" (thus causing FILE("") to return .T.
|
||||
and DIRECTORY("") to return the whole dir content.)
|
||||
! Made sure in UNIX branch that an empty file mask won't
|
||||
return any files regardless of the filename matching
|
||||
method used.
|
||||
|
||||
* harbour/source/rtl/strmatch.c
|
||||
+ Added NOTE about hb_WildMatch() / sx_WildMatch()
|
||||
incompatibility.
|
||||
! Guarded WILDMATCH() with HB_COMPAT_XHB.
|
||||
* WILDMATCH() now calls HB_WILDMATCH() internally.
|
||||
|
||||
2007-05-11 01:04 UTC+0100 Antonio Linares (alinares@fivetechsoft.com)
|
||||
* contrib/adordd/adordd.prg
|
||||
* Reduced used variables and memory
|
||||
|
||||
@@ -56,8 +56,9 @@
|
||||
/* TODO: Xbase++ has an extension where the second parameter can specify
|
||||
the required attribute. */
|
||||
|
||||
/* TOFIX: CA-Cl*pper RTrim()s the filename before doing the existance check.
|
||||
[vszakats] */
|
||||
/* NOTE: CA-Cl*pper RTrim()s the filename before doing the existence check.
|
||||
This is not multiplatform friendly, so Harbour doesn't do any
|
||||
modification on the filename. [vszakats] */
|
||||
|
||||
HB_FUNC( FILE )
|
||||
{
|
||||
|
||||
@@ -655,9 +655,6 @@ static BOOL hb_fsFindNextLow( PHB_FFIND ffind )
|
||||
hb_strncpy( dirname, ".X", sizeof( dirname ) - 1 );
|
||||
dirname[ 1 ] = OS_PATH_DELIMITER;
|
||||
}
|
||||
|
||||
if( info->pattern[ 0 ] == '\0' )
|
||||
hb_strncpy( info->pattern, "*", sizeof( info->pattern ) - 1 );
|
||||
|
||||
tzset();
|
||||
|
||||
@@ -665,7 +662,7 @@ static BOOL hb_fsFindNextLow( PHB_FFIND ffind )
|
||||
hb_strncpy( info->path, dirname, sizeof( info->path ) - 1 );
|
||||
}
|
||||
|
||||
if( info->dir != NULL)
|
||||
if( info->dir != NULL && info->pattern[ 0 ] != '\0' )
|
||||
{
|
||||
while( ( info->entry = readdir( info->dir ) ) != NULL )
|
||||
{
|
||||
@@ -724,7 +721,8 @@ static BOOL hb_fsFindNextLow( PHB_FFIND ffind )
|
||||
}
|
||||
}
|
||||
|
||||
if( !bFound ) hb_fsSetIOError( bFound, 0 );
|
||||
if( ! bFound )
|
||||
hb_fsSetIOError( bFound, 0 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -240,14 +240,6 @@ HB_EXPORT BOOL hb_strMatchWildExact( const char *szString, const char *szPattern
|
||||
return fMatch;
|
||||
}
|
||||
|
||||
HB_FUNC( WILDMATCH )
|
||||
{
|
||||
hb_retl( ( ! ISCHAR( 1 ) || ! ISCHAR( 2 ) ) ? FALSE :
|
||||
hb_parl( 3 ) ? hb_strMatchWildExact( hb_parc( 2 ), hb_parc( 1 ) ) :
|
||||
hb_strMatchWild( hb_parc( 2 ), hb_parc( 1 ) ) );
|
||||
}
|
||||
|
||||
|
||||
/* TODO: Replace it with a code that supports real regular expressions
|
||||
*
|
||||
*/
|
||||
@@ -264,9 +256,23 @@ BOOL hb_strMatchRegExp( const char * szString, const char * szMask )
|
||||
* When lExact is TRUE then it will check if whole cValue is covered by
|
||||
* cPattern else if will check if cPatern is a prefix of cValue
|
||||
*/
|
||||
|
||||
/* NOTE: This function is compatible with sx_WildMatch(), except when
|
||||
the pattern is an empty string where hb_WildMatch() returns
|
||||
.T., while sx_WildMatch() returns .F. [vszakats] */
|
||||
|
||||
HB_FUNC( HB_WILDMATCH )
|
||||
{
|
||||
hb_retl( ( ! ISCHAR( 1 ) || ! ISCHAR( 2 ) ) ? FALSE :
|
||||
hb_parl( 3 ) ? hb_strMatchWildExact( hb_parc( 2 ), hb_parc( 1 ) ) :
|
||||
hb_strMatchWild( hb_parc( 2 ), hb_parc( 1 ) ) );
|
||||
}
|
||||
|
||||
#ifdef HB_COMPAT_XHB
|
||||
|
||||
HB_FUNC( WILDMATCH )
|
||||
{
|
||||
HB_FUNC_EXEC( HB_WILDMATCH );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user