mirror of
git://git.gnu.org.ua/pam-modules.git
synced 2025-04-26 00:19:52 +03:00
transform: fix replacement of particular pattern instance
This fixes handling of expressions like 's/s/@/2'. * lib/transform.c (_single_transform_name_to_slist): Avoid duplicating initial prefix if replace is not needed.
This commit is contained in:
parent
84d3767491
commit
9f0391c84b
1 changed files with 3 additions and 3 deletions
|
@ -572,9 +572,6 @@ _single_transform_name_to_slist (struct transform *tf, gray_slist_t slist,
|
|||
|
||||
disp = rmp[0].rm_eo;
|
||||
|
||||
if (rmp[0].rm_so)
|
||||
gray_slist_append (slist, input, rmp[0].rm_so);
|
||||
|
||||
nmatches++;
|
||||
if (tf->match_number && nmatches < tf->match_number)
|
||||
{
|
||||
|
@ -583,6 +580,9 @@ _single_transform_name_to_slist (struct transform *tf, gray_slist_t slist,
|
|||
continue;
|
||||
}
|
||||
|
||||
if (rmp[0].rm_so)
|
||||
gray_slist_append (slist, input, rmp[0].rm_so);
|
||||
|
||||
for (segm = tf->repl_head; segm; segm = segm->next)
|
||||
{
|
||||
switch (segm->type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue