From 0a09ab02f8ddbb4e3837b8b2611a2cf110b7e6f6 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Fri, 31 Jul 2020 13:15:34 +0200 Subject: issue #7881: More flexible and correct detection of direction of an argument (another fix) --- qtools/qcstring.cpp | 5 ++++- src/util.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qtools/qcstring.cpp b/qtools/qcstring.cpp index 8169979..da7a46f 100644 --- a/qtools/qcstring.cpp +++ b/qtools/qcstring.cpp @@ -616,7 +616,10 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst) if (dst) memcpy(r,dst,dstLen); r+=dstLen; } - qstrcpy(r,p); + if (r) + { + qstrcpy(r,p); + } //printf("substitute(%s,%s,%s)->%s\n",s,src,dst,result.data()); return result; } diff --git a/src/util.cpp b/src/util.cpp index 13b3ca5..aa1acb4 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -8139,7 +8139,7 @@ QCString extractDirection(QCString &docs) { QRegExp re("\\[[ inout,]+\\]"); // [...] int l=0; - if (re.match(docs,0,&l)==0) + if (re.match(docs,0,&l)==0 && l>2) { // make dir the part inside [...] without separators QCString dir=substitute(substitute(docs.mid(1,l-2)," ",""),",",""); -- cgit v0.12