[1231183] 'cleanup: mismatched indentation' and other cleanings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-07-22 17:08:42 +00:00
parent 66e9a9f0ae
commit 7448de8d8d
14 changed files with 413 additions and 404 deletions

View File

@@ -612,11 +612,14 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
nnm = *s ? s + 1 : s;
*s = 0;
// FIXME: wxGetUserHome could return temporary storage in Unicode mode
if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) {
if (was_sep) /* replace only if it was there: */
*s = SEP;
if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL)
{
if (was_sep) /* replace only if it was there: */
*s = SEP;
s = NULL;
} else {
}
else
{
nm = nnm;
s = home;
}
@@ -1778,123 +1781,123 @@ bool wxIsWild( const wxString& pattern )
bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
{
if (text.empty())
if (text.empty())
{
/* Match if both are empty. */
return pat.empty();
}
const wxChar *m = pat.c_str(),
*n = text.c_str(),
*ma = NULL,
*na = NULL,
*mp = NULL,
*np = NULL;
int just = 0,
pcount = 0,
acount = 0,
count = 0;
if (dot_special && (*n == wxT('.')))
{
/* Never match so that hidden Unix files
* are never found. */
return false;
}
for (;;)
{
if (*m == wxT('*'))
{
/* Match if both are empty. */
return pat.empty();
ma = ++m;
na = n;
just = 1;
mp = NULL;
acount = count;
}
const wxChar *m = pat.c_str(),
*n = text.c_str(),
*ma = NULL,
*na = NULL,
*mp = NULL,
*np = NULL;
int just = 0,
pcount = 0,
acount = 0,
count = 0;
if (dot_special && (*n == wxT('.')))
else if (*m == wxT('?'))
{
/* Never match so that hidden Unix files
* are never found. */
m++;
if (!*n++)
return false;
}
for (;;)
else
{
if (*m == wxT('*'))
if (*m == wxT('\\'))
{
m++;
/* Quoting "nothing" is a bad thing */
if (!*m)
return false;
}
if (!*m)
{
/*
* If we are out of both strings or we just
* saw a wildcard, then we can say we have a
* match
*/
if (!*n)
return true;
if (just)
return true;
just = 0;
goto not_matched;
}
/*
* We could check for *n == NULL at this point, but
* since it's more common to have a character there,
* check to see if they match first (m and n) and
* then if they don't match, THEN we can check for
* the NULL of n
*/
just = 0;
if (*m == *n)
{
m++;
if (*n == wxT(' '))
mp = NULL;
count++;
n++;
}
else
{
not_matched:
/*
* If there are no more characters in the
* string, but we still need to find another
* character (*m != NULL), then it will be
* impossible to match it
*/
if (!*n)
return false;
if (mp)
{
ma = ++m;
na = n;
just = 1;
m = mp;
if (*np == wxT(' '))
{
mp = NULL;
acount = count;
}
else if (*m == wxT('?'))
{
m++;
if (!*n++)
return false;
goto check_percent;
}
n = ++np;
count = pcount;
}
else
check_percent:
if (ma)
{
if (*m == wxT('\\'))
{
m++;
/* Quoting "nothing" is a bad thing */
if (!*m)
return false;
}
if (!*m)
{
/*
* If we are out of both strings or we just
* saw a wildcard, then we can say we have a
* match
*/
if (!*n)
return true;
if (just)
return true;
just = 0;
goto not_matched;
}
/*
* We could check for *n == NULL at this point, but
* since it's more common to have a character there,
* check to see if they match first (m and n) and
* then if they don't match, THEN we can check for
* the NULL of n
*/
just = 0;
if (*m == *n)
{
m++;
if (*n == wxT(' '))
mp = NULL;
count++;
n++;
}
else
{
not_matched:
/*
* If there are no more characters in the
* string, but we still need to find another
* character (*m != NULL), then it will be
* impossible to match it
*/
if (!*n)
return false;
if (mp)
{
m = mp;
if (*np == wxT(' '))
{
mp = NULL;
goto check_percent;
}
n = ++np;
count = pcount;
}
else
check_percent:
if (ma)
{
m = ma;
n = ++na;
count = acount;
}
else
return false;
}
m = ma;
n = ++na;
count = acount;
}
else
return false;
}
}
}
}
// Return the type of an open file