Re: [PATCH 1/2] lib/string_helpers: add ESCAPE_BACKSLASH flag to string_escape_mem()

From: Andy Shevchenko

Date: Mon Sep 28 2026 - 04:19:20 EST


On Mon, Sep 28, 2026 at 11:11:53AM +0300, Andy Shevchenko wrote:
> On Sat, Sep 26, 2026 at 11:57 PM Muhammad Bilal <meatuni001@xxxxxxxxx> wrote:
> >
> > ESCAPE_SPECIAL escapes '\\', '\a', '\e' and '"' as one group. A caller
> > that wants '\\' escaped but needs '"' left untouched, because it has
> > its own handling for quotes or because quoting is not meaningful in
> > its output, currently has no way to pull just the backslash case out
> > of that set.
> >
> > Add ESCAPE_BACKSLASH, which escapes only '\\'. It can be combined with
> > ESCAPE_SPACE, or used on its own, without pulling in ESCAPE_SPECIAL's
> > quote and control-character handling.
>
> But why? I believe it can be done in the current implementation using
> the last argument @only (id est use the list of the characters you
> want to escape).
>
> > This only adds a new opt-in flag; no existing caller changes
> > behavior.
>
> No test cases --> automatically NAK.

...

> Also you missed printk() update and respective documentation.

And on top of that, I have neither cover letter, nor patch 2/2 in my mailbox.
If you think that it's not important to me as lib/string* reviewer/contributor,
you are mistaken (yes, I can retrieve from lore, but this doesn't change
the fact).

--
With Best Regards,
Andy Shevchenko