Skip to content
Snippets Groups Projects
Commit 05374810 authored by rswindell's avatar rswindell
Browse files

glob() now sorts alphabetically by default (ala Unix), but case-insensitive.

getfreediskspace now returns (2GB) if more than 4GB free.
parent 8b7293fa
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,13 @@
#ifdef __BORLANDC__
#pragma argsused
#endif
static int glob_compare( const void *arg1, const void *arg2 )
{
/* Compare all of both strings: */
return stricmp( * ( char** ) arg1, * ( char** ) arg2 );
}
int DLLCALL glob(const char *pattern, int flags, void* unused, glob_t* glob)
{
struct _finddata_t ff;
......@@ -140,6 +147,10 @@ int DLLCALL glob(const char *pattern, int flags, void* unused, glob_t* glob)
if(found==0)
return(GLOB_NOMATCH);
if(!(flags&GLOB_NOSORT)) {
qsort(glob->gl_pathv,found,sizeof(char*),glob_compare);
}
return(0); /* success */
}
......@@ -384,7 +395,7 @@ ulong DLLCALL getfreediskspace(char* path)
#else
if(avail.u.HighPart)
#endif
return(~0); /* 4GB max */
return(0x7fffffff); /* 2GB max */
#ifdef _ANONYMOUS_STRUCT
return(avail.LowPart);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment