Commit 30df2f0d authored by Laurent Montel's avatar Laurent Montel 😁

Fix bug with comment which has an unique char

parent ec76c892
#SCRIPTNAME: Script part 0
if header :is "X-Spam-Flag" "YES" #1
#2
#3
#2
#3
{
stop;
}
}
\ No newline at end of file
......@@ -111,7 +111,6 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts()
QEXPECT_FAIL("failed-if-in-if", "Expected failure on failed-if-in-if file. Problem with if in another if.", Continue);
QEXPECT_FAIL("test-comment2", "Expected failure on test-comment2 file. Problem with # and /* .", Continue);
QEXPECT_FAIL("test-comment7", "Expected failure on test-comment7 file. Problem comment after an action .", Continue);
QEXPECT_FAIL("test-comment8", "Expected failure on test-comment8 file. Problem with comment with 1 char .", Continue);
QCOMPARE(proc.exitCode(), 0);
}
}
......
......@@ -39,6 +39,7 @@
#include <QString>
#include <QStringList>
#include <QTextCodec>
#include <QDebug>
#include <memory> // std::unique_ptr
......@@ -367,12 +368,12 @@ bool Lexer::Impl::parseHashComment(QString &result, bool reallySave)
}
++mState.cursor;
}
const char *const commentEnd = mState.cursor - 1;
if (commentEnd == commentStart) {
return true; // # was last char in script...
}
//Laurent it creates a problem when we have just "#F" => it doesn't see it as a comment
// if (commentEnd == commentStart) {
// return true; // # was last char in script...
// }
if (atEnd() || eatCRLF()) {
const int commentLength = commentEnd - commentStart + 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment