diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-05-08 21:32:24 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-05-08 21:32:24 (GMT) |
commit | 23885c2f2db71f003578f0d1b44555c067bfd7a5 (patch) | |
tree | c4bbe961812e7008b9e85fd820596290c043c0f6 /src/commentscan.l | |
parent | 5d31b7ab211586100301d6838be82f066f8f9af4 (diff) | |
download | Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.zip Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.tar.gz Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.tar.bz2 |
Release-1.4.2-20050508
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index bbb0ab6..e8f3725 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -545,6 +545,19 @@ static void addSection() //----------------------------------------------------------------------------- +// strip trailing whitespace (excluding newlines) from string s +static void stripTrailingWhiteSpace(QCString &s) +{ + uint len = s.length(); + int i = (int)len-1; + char c; + while (i>=0 && ((c = s.at(i))==' ' || c=='\t' || c=='\r')) i--; + if (i!=(int)len-1) + { + s.resize(i+2); // string upto and including char at pos i and \0 terminator + } +} + // selects the output to write to static inline void setOutput(OutputContext ctx) { @@ -610,6 +623,7 @@ static inline void setOutput(OutputContext ctx) switch(inContext) { case OutputDoc: + stripTrailingWhiteSpace(current->doc); if (current->docFile.isEmpty()) { current->docFile = yyFileName; @@ -842,7 +856,7 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) addOutput(yytext[2]); } <Comment>(\n|\\_linebr)({B}*(\n|\\_linebr))+ { // at least one blank line (or blank line command) - if (inContext) + if (inContext==OutputBrief) { setOutput(OutputDoc); } |