diff --git a/ChangeLog.txt b/ChangeLog.txt index ddfb5eb8fc..d7db4e5c7d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,22 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2016-04-01 00:28 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rtl/direct.c + ! removed set of MS-Windows attributes passed unconditionally to + hb_fsFind*() functions in Directory() PRG function. + It fixes "L" attribute passed in 2-d parameter of Directory() + function in *nix builds. When "L" is given in attribute list + then Directory() do not follow links. + + * src/common/strwild.c + * removed FNM_PERIOD from fnmatch() parameters in *nix builds + + * src/common/hbffind.c + * in * nix builds set hidden attribute for file and directory + names starting with "." except "." and ".." which are reported + as is for Cl*pper and Harbour multiplatform compatibility. + 2016-03-30 16:35 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * include/hbdefs.h ! use "ll" instead of "I64" as 64bit integer modifier in *printf() diff --git a/src/common/hbffind.c b/src/common/hbffind.c index 192c046f99..1520ef3dfe 100644 --- a/src/common/hbffind.c +++ b/src/common/hbffind.c @@ -801,6 +801,12 @@ static HB_BOOL hb_fsFindNextLow( PHB_FFIND ffind ) nAttr |= HB_FA_LINK; } #endif + if( info->entry->d_name[ 0 ] == '.' ) + { + if( info->entry->d_name[ 1 ] && + ( info->entry->d_name[ 1 ] != '.' || info->entry->d_name[ 2 ] ) ) + nAttr |= HB_FA_HIDDEN; + } hb_strncpy( ffind->szName, info->entry->d_name, sizeof( ffind->szName ) - 1 ); ffind->size = sStat.st_size; diff --git a/src/common/strwild.c b/src/common/strwild.c index 882f0c45f9..caf9abb719 100644 --- a/src/common/strwild.c +++ b/src/common/strwild.c @@ -280,7 +280,7 @@ HB_BOOL hb_strMatchFile( const char * szString, const char * szPattern ) # if defined( HB_NO_FNMATCH ) return hb_strMatchWildExact( szString, szPattern ); # else - return fnmatch( szPattern, szString, FNM_PERIOD | FNM_PATHNAME ) == 0; + return fnmatch( szPattern, szString, FNM_PATHNAME ) == 0; # endif #elif defined( HB_OS_DOS ) || defined( HB_OS_WIN ) || defined( HB_OS_OS2 ) PHB_CODEPAGE cdp = hb_vmCDP(); diff --git a/src/rtl/direct.c b/src/rtl/direct.c index 139500e8c2..15128f19f9 100644 --- a/src/rtl/direct.c +++ b/src/rtl/direct.c @@ -106,17 +106,7 @@ PHB_ITEM hb_fsDirectory( const char * pszDirSpec, const char * pszAttributes, HB /* Get the passed attributes and convert them to Harbour Flags */ - ulMask = HB_FA_ARCHIVE | - HB_FA_READONLY | - HB_FA_DEVICE | - HB_FA_TEMPORARY | - HB_FA_SPARSE | - HB_FA_REPARSE | - HB_FA_COMPRESSED | - HB_FA_OFFLINE | - HB_FA_NOTINDEXED | - HB_FA_ENCRYPTED | - HB_FA_VOLCOMP; + ulMask = HB_FA_ARCHIVE | HB_FA_READONLY; if( pszAttributes && *pszAttributes ) ulMask |= hb_fsAttrEncode( pszAttributes );