forked from qt-creator/qt-creator
Find usage displays content of the first line
Task-number: QTCREATERBUG-6176 Change-Id: I1c45b951bfde0b0d33bf462f532da7cbdbaa3fe7 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
committed by
Leandro Melo
parent
3fe2113a2b
commit
e44254bb9f
@@ -50,17 +50,21 @@ QString fetchLine(const QByteArray &bytes, const int line)
|
||||
{
|
||||
int current = 0;
|
||||
const char *s = bytes.constData();
|
||||
|
||||
if (line) {
|
||||
while (*s) {
|
||||
if (*s == '\n') {
|
||||
++current;
|
||||
if (current == line)
|
||||
if (line == current) {
|
||||
++s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
++s;
|
||||
}
|
||||
}
|
||||
|
||||
if (current == line) {
|
||||
++s;
|
||||
const char *e = s;
|
||||
while (*e && *e != '\n')
|
||||
++e;
|
||||
|
Reference in New Issue
Block a user