summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-04-16 18:48:42 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-04-16 18:48:42 (GMT)
commitc4e631c991c8d7a6380270b193f5628ed00968c1 (patch)
tree8e3deb15e69456a77b64a6af15f726968889295f /src
parent63492f6c10279652fff2c84d181d150399d5d2c5 (diff)
parent3cc116ba2250e6946773ec22c6c7c6557773d28e (diff)
downloadDoxygen-c4e631c991c8d7a6380270b193f5628ed00968c1.zip
Doxygen-c4e631c991c8d7a6380270b193f5628ed00968c1.tar.gz
Doxygen-c4e631c991c8d7a6380270b193f5628ed00968c1.tar.bz2
Merge pull request #327 from wtschueller/master
Tcl: fix for extra line breaks in source browser introduced by commit 31...
Diffstat (limited to 'src')
-rw-r--r--src/tclscanner.l10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tclscanner.l b/src/tclscanner.l
index 6ad2e26..7befd40 100644
--- a/src/tclscanner.l
+++ b/src/tclscanner.l
@@ -666,7 +666,9 @@ static void tcl_codify(const char *s,const char *str)
tcl.code->startFontClass(s);
tcl.code_font=s;
}
- const char *p=str,*sp=p;
+ char *tmp = (char *) malloc(strlen(str)+1);
+ strcpy(tmp, str);
+ char *p=tmp,*sp=p;
char c;
bool done=FALSE;
while (!done)
@@ -676,7 +678,10 @@ static void tcl_codify(const char *s,const char *str)
if (c=='\n')
{
tcl.code_line++;
- // *(p-1)='\0'; // Dimitri: is this really needed?
+ *(p-1)='\0'; // Dimitri: is this really needed?
+ // wtschueller: As far as I can see: yes.
+ // Deletes that \n that would produce ugly source listings otherwise.
+ // However, there may exist more sophisticated solutions.
tcl.code->codify(sp);
if (tcl.code_font)
{
@@ -699,6 +704,7 @@ static void tcl_codify(const char *s,const char *str)
done=TRUE;
}
}
+ free(tmp);
tcl_font_end();
}