On Wed, Sep 04, 2024 at 04:23:17PM +0200, Emanuele Torre wrote:
> 
> I have not looked at the code of busybox sed much, but I think there is
> alredy some code that can detect whether a character is in a bracket

Not totally true. Similar logic exist in editors/sed.c:366,
index_of_next_unescaped_regexp_delim(), but doesn't handle elements
containing a bracket, like word class, correctly. For example,

        echo a | sed 's/[[:alpha:]/]/b/'

        busybox:
                sed: bad option in substitution expression
        GNU sed:
                b

This function should be fixed as well.

> expression or not because in e.g.   s/[/]//   the / in the bracket
> expression does not terminate the pattern of the substitute command.
> 
> Maybe you can reuse or adapt that code.

Best regards,
Yao Zi
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to