summaryrefslogtreecommitdiff
path: root/sed
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2011-05-27 09:37:25 +0200
committerPaolo Bonzini <bonzini@gnu.org>2011-05-27 09:37:25 +0200
commit607d56e0849a54860521393311df74b3cf0b3f89 (patch)
tree2d60121ce0e42ddc6f276477474cdbd9180db7d9 /sed
parentb63b14863195a56fab16f4d42728cc5ec3f92cb7 (diff)
downloadsed-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.c12
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, &regs, repl_mod);
+ append_replacement (&s_accum, sub->replacement, &regs);
again = sub->global;
}
else