projects
/
monky
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80ee83c
)
Fix wrong output when nesting $combine-s
author
Nikolas Garofil
<nikolas@garofil.be>
Mon, 22 Feb 2010 18:35:36 +0000
(19:35 +0100)
committer
Nikolas Garofil
<nikolas@garofil.be>
Mon, 22 Feb 2010 18:35:36 +0000
(19:35 +0100)
src/combine.c
patch
|
blob
|
history
diff --git
a/src/combine.c
b/src/combine.c
index
18b2bc4
..
d9a8063
100644
(file)
--- a/
src/combine.c
+++ b/
src/combine.c
@@
-118,7
+118,8
@@
void print_combine(struct text_object *obj, char *p, struct information *cur)
generate_text_internal(buf[i], max_user_text, *objsub, cur);
for(j=0; buf[i][j] != 0; j++) {
if(buf[i][j] == '\t') buf[i][j] = ' ';
generate_text_internal(buf[i], max_user_text, *objsub, cur);
for(j=0; buf[i][j] != 0; j++) {
if(buf[i][j] == '\t') buf[i][j] = ' ';
- if(buf[i][j] == '\n' || buf[i][j] == 2) { //Some vars like $head use \002 instead of \n to separate lines
+ if(buf[i][j] == '\n') buf[i][j] = 0; //the vars inside combine may not have a \n at the end
+ if(buf[i][j] == 2) { // \002 is used instead of \n to separate lines inside a var
buf[i][j] = 0;
current[i]->row = strdup(buf[i]+nextstart);
if(i==0 && (long)strlen(current[i]->row) > longest) longest = (long)strlen(current[i]->row);
buf[i][j] = 0;
current[i]->row = strdup(buf[i]+nextstart);
if(i==0 && (long)strlen(current[i]->row) > longest) longest = (long)strlen(current[i]->row);