summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CRegExp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/CRegExp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CRegExp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/CRegExp.cpp b/noncore/apps/opie-reader/CRegExp.cpp
index 6318d28..e3194df 100644
--- a/noncore/apps/opie-reader/CRegExp.cpp
+++ b/noncore/apps/opie-reader/CRegExp.cpp
@@ -64,97 +64,97 @@ void CRegExpFilt::prepreprocessing(const QString& pat, bool insens)
#ifdef _WINDOWS
switch (pat.at(p).unicode())
#else
switch (pat[p].unicode())
#endif
{
case '{':
{
break;
}
case '}':
{
break;
}
case '^':
{
break;
}
case '.' :
{
break;
}
case '#':
{
p++;
#ifdef _WINDOWS
while ('0' <= pat.at(p).unicode() && pat.at(p).unicode() <= '9')
#else
while ('0' <= pat[p].unicode() && pat[p].unicode() <= '9')
#endif
{
}
p--;
break;
}
case '\\' :
{
#ifdef _WINDOWS
tchar c = escapedchar(pat.at(++p).unicode());
#else
tchar c = escapedchar(pat[++p].unicode());
#endif
regchar(c, insens);
break;
}
case '[' :
{
- tchar clast;
+ tchar clast = 0;
bool invert = false;
tchar c;
#ifdef _WINDOWS
if (pat.at(p+1).unicode() == '^')
#else
if (pat[p+1].unicode() == '^')
#endif
{
p++;
invert = true;
}
#ifdef _WINDOWS
while ((c = pat.at(++p).unicode()) != ']')
#else
while ((c = pat[++p].unicode()) != ']')
#endif
{
if (c == '\\')
{
#ifdef _WINDOWS
c = escapedchar(pat.at(++p).unicode());
#else
c = escapedchar(pat[++p].unicode());
#endif
if (c == ']') break;
}
if (c == '-')
{
#ifdef _WINDOWS
c = pat.at(++p).unicode();
#else
c = pat[++p].unicode();
#endif
for (tchar j = clast; j <= c; j++)
{
regchar(j, insens);
}
}
else
{
regchar(c, insens);
}
clast = c;
}
break;
}
default :
{
@@ -242,97 +242,97 @@ unsigned int CRegExpFilt::preprocessing(const QString& pat, bool insens)
#endif
}
p--;
count = count-1;
unsigned int mask = 0;
for (unsigned int i = m; i < m+count; i++)
{
mask |= bit[i];
}
for (iter it = CV.begin(); it != CV.end(); ++it)
{
if (CV[it.first()] & bit[m-1])
{
CV[it.first()] |= mask;
}
}
if (keep & bit[m-1]) keep |= mask;
m += count;
}
else
{
p++;
}
break;
}
case '\\' :
{
#ifdef _WINDOWS
tchar c = escapedchar(pat.at(++p).unicode());
#else
tchar c = escapedchar(pat[++p].unicode());
#endif
if (insens)
{
CV[upper(c)] |= bit[m];
CV[lower(c)] |= bit[m];
}
else
{
CV[c] |= bit[m];
}
m++;
break;
}
case '[' :
{
- tchar c, clast;
+ tchar c, clast = 0;
bool invert = false;
#ifdef _WINDOWS
if (pat.at(p+1).unicode() == '^')
#else
if (pat[p+1].unicode() == '^')
#endif
{
p++;
invert = true;
}
#ifdef _WINDOWS
while ((c = pat.at(++p).unicode()) != ']')
#else
while ((c = pat[++p].unicode()) != ']')
#endif
{
if (c == '\\')
{
#ifdef _WINDOWS
c = escapedchar(pat.at(++p).unicode());
#else
c = escapedchar(pat[++p].unicode());
#endif
if (c == ']') break;
}
if (c == '-')
{
#ifdef _WINDOWS
c = pat.at(++p).unicode();
#else
c = pat[++p].unicode();
#endif
for (tchar j = clast; j <= c; j++)
{
if (insens)
{
iter it;
if ((it = CV.find(upper(j))) != CV.end())
CV[it] |= bit[m];
else
CV[0] |= bit[m];
if ((it = CV.find(lower(j))) != CV.end())
CV[it] |= bit[m];
else
CV[0] |= bit[m];
}
else
{