simplify the code handling \l and \u
2011-05-27 Paolo Bonzini <bonzini@gnu.org> * sed/execute.c (append_replacement, do_subst): Further simplification.
This commit is contained in:
1 parent
923b8429c8
commit
54da30b4fc
2 files changed
+10
-7
No files matched your search
@@ -1,3 +1,8 @@
|
||||
2011-05-27 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* sed/execute.c (append_replacement, do_subst): Further
|
||||
simplification.
|
||||
|
||||
2012-03-16 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* basicdefs.h (FREE): Remove.
|
||||
|
||||
+5
-7
@@ -1011,15 +1011,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;
|
||||
@@ -1100,8 +1100,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];
|
||||
|
||||
@@ -1125,7 +1123,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
|
||||
|
||||
Reference in new issue
Block a user