diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-20 11:51:58 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-20 11:51:58 (GMT) |
commit | 1a632e1bc677fce4b8d5450ce4a971fdde3ed42f (patch) | |
tree | 222c48a9d90097b3ea61cb2839b6541eff185c3a /src/corelib/codecs/qtextcodec.cpp | |
parent | 9bd8df2b405ef517d2d1b209b8004aaaa4994242 (diff) | |
parent | 3d6381b47a6048d04dbfc7b6984cae81c02d4fe6 (diff) | |
download | Qt-1a632e1bc677fce4b8d5450ce4a971fdde3ed42f.zip Qt-1a632e1bc677fce4b8d5450ce4a971fdde3ed42f.tar.gz Qt-1a632e1bc677fce4b8d5450ce4a971fdde3ed42f.tar.bz2 |
Merge commit 'origin/4.5'
Conflicts:
src/3rdparty/webkit/VERSION
src/3rdparty/webkit/WebCore/ChangeLog
src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
src/3rdparty/webkit/WebCore/page/DOMWindow.idl
src/corelib/io/qdiriterator.cpp
src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
tests/auto/qxmlquery/tst_qxmlquery.cpp
tools/linguist/lconvert/main.cpp
Diffstat (limited to 'src/corelib/codecs/qtextcodec.cpp')
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index c4266a0..bdf7cd5 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -99,6 +99,10 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QTextCodecFactoryInterface_iid, QLatin1String("/codecs"))) #endif +static char qtolower(register char c) +{ if (c >= 'A' && c <= 'Z') return c + 0x20; return c; } +static bool qisalnum(register char c) +{ return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); } static bool nameMatch(const QByteArray &name, const QByteArray &test) { @@ -111,21 +115,21 @@ static bool nameMatch(const QByteArray &name, const QByteArray &test) // if the letters and numbers are the same, we have a match while (*n != '\0') { - if (isalnum((uchar)*n)) { + if (qisalnum(*n)) { for (;;) { if (*h == '\0') return false; - if (isalnum((uchar)*h)) + if (qisalnum(*h)) break; ++h; } - if (tolower((uchar)*n) != tolower((uchar)*h)) + if (qtolower(*n) != qtolower(*h)) return false; ++h; } ++n; } - while (*h && !isalnum((uchar)*h)) + while (*h && !qisalnum(*h)) ++h; return (*h == '\0'); } |