summaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-02-28 13:24:04 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-02-28 13:24:04 (GMT)
commite15c80cbf1c0f35c2d2ddc950e3d653bc24aac4e (patch)
tree8c1e8dfbf80ca98cf11864219744ba87e0b49e70 /addon
parentb6f01ff09b17e5c2288f2418ef0a8f074456c357 (diff)
downloadDoxygen-e15c80cbf1c0f35c2d2ddc950e3d653bc24aac4e.zip
Doxygen-e15c80cbf1c0f35c2d2ddc950e3d653bc24aac4e.tar.gz
Doxygen-e15c80cbf1c0f35c2d2ddc950e3d653bc24aac4e.tar.bz2
Bug 653502 - Can't use pound sign in alias command, escaped or unescaped
- In case there is already a double quote at the beginning of the line disable further escaping (assume that there is an end double quote as well) - In case a hash sign is present see to it that the string will have double quotes around the alias.
Diffstat (limited to 'addon')
-rw-r--r--addon/doxywizard/config_doxyw.l29
1 files changed, 22 insertions, 7 deletions
diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l
index 7874a19..960b7cb 100644
--- a/addon/doxywizard/config_doxyw.l
+++ b/addon/doxywizard/config_doxyw.l
@@ -540,22 +540,34 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s)
{
QChar c;
bool needsEscaping=false;
+ bool needsHashEscaping=false;
// convert the string back to it original encoding
//QByteArray se = codec->fromUnicode(s);
t.setCodec(codec);
const QChar *p=s.data();
if (!s.isEmpty() && !p->isNull())
{
- while (!(c=*p++).isNull() && !needsEscaping)
+ if (*p != QChar::fromLatin1('"'))
{
- needsEscaping = (c==QChar::fromLatin1(' ') ||
- c==QChar::fromLatin1('\n') ||
- c==QChar::fromLatin1('\t') ||
- c==QChar::fromLatin1('"'));
+ while (!(c=*p++).isNull() && !needsEscaping)
+ {
+ needsEscaping = (c==QChar::fromLatin1(' ') ||
+ c==QChar::fromLatin1('\n') ||
+ c==QChar::fromLatin1('\t') ||
+ c==QChar::fromLatin1('"'));
+ }
+ p=s.data();
+ while (!(c=*p++).isNull() && !needsHashEscaping)
+ {
+ needsHashEscaping = (c==QChar::fromLatin1('#'));
+ }
}
- if (needsEscaping)
+ if (needsHashEscaping || needsEscaping)
{
t << "\"";
+ }
+ if (needsEscaping)
+ {
p=s.data();
while (!p->isNull())
{
@@ -564,12 +576,15 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s)
if (*p ==QChar::fromLatin1('"')) t << "\\"; // escape quotes
t << *p++;
}
- t << "\"";
}
else
{
t << s;
}
+ if (needsHashEscaping || needsEscaping)
+ {
+ t << "\"";
+ }
}
}