diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c843ca601d..3d529f5681 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +19990606-20:20 CET Victor Szel + + * source/rtl/dir.c - + HB_CHARUPPER() parameters were wrong. + HB_CHARUPPER() converted to toupper() + The attribute parameter conversion to uppercase was buggy. + 19990606-15:20 CET Eddie Runia * source/compiler/harbour.y - : is now functioning ! diff --git a/harbour/source/rtl/dir.c b/harbour/source/rtl/dir.c index 653e4680f1..6bd07e688b 100644 --- a/harbour/source/rtl/dir.c +++ b/harbour/source/rtl/dir.c @@ -6,8 +6,6 @@ #include #include -#define HB_CHARUPPER(c) ((c)>='a'&&(c)<='z'?(c)-32:(c)) - #if defined(__GNUC__) || defined(__DJGPP__) #include #include @@ -309,10 +307,11 @@ HARBOUR DIRECTORY( void ) /* TODO: attribute match rtn */ pos = 0; - if( arg2_it ) + if( arg2_it && _parclen(2) >= 1) { strcpy(string, _parc(2)); - pos = strchr(HB_CHARUPPER(string),*aatrib); + while (string[pos]) string[pos] = toupper(string[pos]); + pos = strchr(string,*aatrib); } else pos = 1; @@ -368,12 +367,12 @@ static BOOL hb_strMatchDOS (char *pszString, char *pszMask) pszString++; else { - while (HB_CHARUPPER(pszString) != HB_CHARUPPER(pszMask)) + while (toupper(*pszString) != toupper(*pszMask)) { if (!(*(++pszString))) return (FALSE); } - while (HB_CHARUPPER(pszString) == HB_CHARUPPER(pszMask)) + while (toupper(*pszString) == toupper(*pszMask)) { if (!(*(++pszString))) break; @@ -382,7 +381,7 @@ static BOOL hb_strMatchDOS (char *pszString, char *pszMask) } } else - if (HB_CHARUPPER(pszMask) != HB_CHARUPPER(pszString) && *pszMask != '?') + if (toupper(*pszMask) != toupper(*pszString) && *pszMask != '?') return (FALSE); else {