summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2012-10-18 18:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-30 00:06:26 +0100
commit6497649730daeab5d3dfac7e806105e99a237656 (patch)
tree3ff5e196d5e0bef889a6fcae07f9428965aa3f7c /src
parentd3c1a9f38784c8d3a439517cc971320d74613869 (diff)
Check for both A and P when converting QDateTime to string.
hasUnquotedAP currently only checks for an a or A, which is wrong according to both the toString documentation and the comments for hasUnquotedAP. Change-Id: I03015734b846fe761085cf8f8fca2b29210cff97 Reviewed-by: Jon Severinsson <jon@severinsson.net> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qdatetime.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 67dbbef9ad..12f9335990 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -3743,7 +3743,8 @@ static bool hasUnquotedAP(const QString &f)
for (int i=0; i<max; ++i) {
if (f.at(i) == quote) {
inquote = !inquote;
- } else if (!inquote && f.at(i).toUpper() == QLatin1Char('A')) {
+ } else if (!inquote && f.at(i).toUpper() == QLatin1Char('A')
+ && i + 1 < max && f.at(i + 1).toUpper() == QLatin1Char('P')) {
return true;
}
}