summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2013-10-15 16:25:22 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-15 23:58:00 +0200
commit688b006cc8d8d4d9ce1f29049f96d4d590bb60d7 (patch)
tree7dc275e096cbea779ca434de052c673878414c96 /src
parent0a19ee0aea330c2f46c8fe7cc461adb1060ec6df (diff)
QTimeZone - Fix finding Linux System Time Zone
Extract the correct length sub-string from the /etc/sysconfig/clock file Change-Id: I37b4f625a51b172ed11ecefbd1b7dc562c5bb89d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 62b8f5f7b6..4bf19178fa 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -883,9 +883,9 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
while (olsenId.isEmpty() && !ts.atEnd() && ts.status() == QTextStream::Ok) {
line = ts.readLine();
if (line.left(5) == QStringLiteral("ZONE=")) {
- olsenId = line.mid(6, line.size() - 2).toUtf8();
+ olsenId = line.mid(6, line.size() - 7).toUtf8();
} else if (line.left(9) == QStringLiteral("TIMEZONE=")) {
- olsenId = line.mid(6, line.size() - 2).toUtf8();
+ olsenId = line.mid(10, line.size() - 11).toUtf8();
}
}
}