three tokens: + + ID. Therefore a token separator is
inserted after the replacement.
*/
- if (*(repl->r_ptr - 1) != TOKSEP) add2repl(repl, TOKSEP);
+ if (repl->r_text == repl->r_ptr || *(repl->r_ptr - 1) != TOKSEP) {
+ add2repl(repl, TOKSEP);
+ }
return 1;
}
while (*q)
add2repl(repl, *q++);
- if (*(repl->r_ptr - 1) != TOKSEP)
+ if (repl->r_text == repl->r_ptr || *(repl->r_ptr - 1) != TOKSEP)
add2repl(repl, TOKSEP);
} else {
add2repl(repl, *ptr++);
three tokens: + + ID. Therefore a token separator is
inserted after the replacement.
*/
- if (*(repl->r_ptr -1) != TOKSEP) add2repl(repl, TOKSEP);
+ if (repl->r_text == repl->r_ptr || *(repl->r_ptr -1) != TOKSEP) {
+ add2repl(repl, TOKSEP);
+ }
return 1;
}
while (*q)
add2repl(repl, *q++);
- if (*(repl->r_ptr-1) != TOKSEP)
+ if (repl->r_text == repl->r_ptr || *(repl->r_ptr-1) != TOKSEP)
add2repl(repl, TOKSEP);
} else {
add2repl(repl, *ptr++);