diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2011-05-27 09:37:25 +0200 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2011-05-27 09:37:25 +0200 |
commit | 607d56e0849a54860521393311df74b3cf0b3f89 (patch) | |
tree | 2d60121ce0e42ddc6f276477474cdbd9180db7d9 /sed | |
parent | b63b14863195a56fab16f4d42728cc5ec3f92cb7 (diff) | |
download | sed-607d56e0849a54860521393311df74b3cf0b3f89.tar.gz |
document corner case of \l and \u, and simplify the code handling it
2011-05-27 Paolo Bonzini <bonzini@gnu.org>
* doc/sed-in.texi: Explain behavior of \l and \u at the end
of the replacement text.
* doc/sed.texi: Regenerate.
* sed/execute.c (append_replacement, do_subst): Further
simplification.
Diffstat (limited to 'sed')
-rw-r--r-- | sed/execute.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sed/execute.c b/sed/execute.c index a8514be..befc8f9 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -1126,15 +1126,15 @@ do_list(line_len) static void append_replacement P_((struct line *, struct replacement *, - struct re_registers *, - enum replacement_types)); + struct re_registers *)); static void -append_replacement (buf, p, regs, repl_mod) +append_replacement (buf, p, regs) struct line *buf; struct replacement *p; struct re_registers *regs; - enum replacement_types repl_mod; { + enum replacement_types repl_mod = 0; + for (; p; p=p->next) { int i = p->subst_id; @@ -1215,8 +1215,6 @@ do_subst(sub) do { - enum replacement_types repl_mod = 0; - size_t offset = regs.start[0]; size_t matched = regs.end[0] - regs.start[0]; @@ -1240,7 +1238,7 @@ do_subst(sub) replaced = true; /* Now expand the replacement string into the output string. */ - append_replacement (&s_accum, sub->replacement, ®s, repl_mod); + append_replacement (&s_accum, sub->replacement, ®s); again = sub->global; } else |