diff --git a/autotests/folding/test.c.fold b/autotests/folding/test.c.fold
--- a/autotests/folding/test.c.fold
+++ b/autotests/folding/test.c.fold
@@ -25,6 +25,7 @@
static const char c1 = 'c';
static const char c2 = '\n';
static const char c2a = '\120'; // octal
+static const char c2o = '\0'; // octal, special case
static const char c2b = '\x1f'; // hex
static const char c2c = '\'';
static const char c2d = '\\';
diff --git a/autotests/html/test.c.html b/autotests/html/test.c.html
--- a/autotests/html/test.c.html
+++ b/autotests/html/test.c.html
@@ -31,6 +31,7 @@
static const char c1 = 'c';
static const char c2 = '\n';
static const char c2a = '\120'; // octal
+static const char c2o = '\0'; // octal, special case
static const char c2b = '\x1f'; // hex
static const char c2c = '\'';
static const char c2d = '\\';
diff --git a/autotests/html/test.qdocconf.html b/autotests/html/test.qdocconf.html
--- a/autotests/html/test.qdocconf.html
+++ b/autotests/html/test.qdocconf.html
@@ -41,7 +41,7 @@
buildversion = "GammaRay User Manual $QT_VERSION"
# backward compatibility with Qt < 5.7
-macro.borderedimage = "\\div {class=\"border\"} \\image \1\n\\enddiv"
+macro.borderedimage = "\\div {class=\"border\"} \\image \1\n\\enddiv"
include(gammaray-manual.qdocconf)
diff --git a/autotests/input/test.c b/autotests/input/test.c
--- a/autotests/input/test.c
+++ b/autotests/input/test.c
@@ -25,6 +25,7 @@
static const char c1 = 'c';
static const char c2 = '\n';
static const char c2a = '\120'; // octal
+static const char c2o = '\0'; // octal, special case
static const char c2b = '\x1f'; // hex
static const char c2c = '\'';
static const char c2d = '\\';
diff --git a/autotests/reference/test.c.ref b/autotests/reference/test.c.ref
--- a/autotests/reference/test.c.ref
+++ b/autotests/reference/test.c.ref
@@ -25,6 +25,7 @@
static const char c1 = 'c';
static const char c2 = '\n';
static const char c2a = '\120'; // octal
+static const char c2o = '\0'; // octal, special case
static const char c2b = '\x1f'; // hex
static const char c2c = '\'';
static const char c2d = '\\';
diff --git a/autotests/reference/test.qdocconf.ref b/autotests/reference/test.qdocconf.ref
--- a/autotests/reference/test.qdocconf.ref
+++ b/autotests/reference/test.qdocconf.ref
@@ -35,7 +35,7 @@
buildversion = "GammaRay User Manual $QT_VERSION"
# backward compatibility with Qt < 5.7
-macro.borderedimage = "\\div {class=\"border\"} \\image \1\n\\enddiv"
+macro.borderedimage = "\\div {class=\"border\"} \\image \1\n\\enddiv"
include(gammaray-manual.qdocconf)
diff --git a/src/lib/rule.cpp b/src/lib/rule.cpp
--- a/src/lib/rule.cpp
+++ b/src/lib/rule.cpp
@@ -59,7 +59,8 @@
if (controlChars.contains(c))
return offset + 2;
- if (c == QLatin1Char('x')) { // hex encoded character
+ // hex encoded character
+ if (c == QLatin1Char('x')) {
auto newOffset = offset + 2;
for (int i = 0; i < 2 && newOffset + i < text.size(); ++i, ++newOffset) {
if (!isHexChar(text.at(newOffset)))
@@ -70,14 +71,13 @@
return newOffset;
}
- if (isOctalChar(c)) { // octal encoding
+ // octal encoding, simple \0 is OK, too, unlike simple \x above
+ if (isOctalChar(c)) {
auto newOffset = offset + 2;
for (int i = 0; i < 2 && newOffset + i < text.size(); ++i, ++newOffset) {
if (!isOctalChar(text.at(newOffset)))
break;
}
- if (newOffset == offset + 2)
- return offset;
return newOffset;
}