bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Corrupted multibyte characters in command substitutions fixes may be


From: Alex fxmbsw7 Ratchev
Subject: Re: Corrupted multibyte characters in command substitutions fixes may be worse than problem.
Date: Mon, 7 Feb 2022 11:55:50 +0100

On Mon, Feb 7, 2022 at 7:45 AM Lawrence Velázquez <vq@larryv.me> wrote:
>
> On Mon, Feb 7, 2022, at 1:26 AM, Alex fxmbsw7 Ratchev wrote:
> > well i saw now, printf a char of "\0" results in 0 bytes out to wc -c
>
> % /usr/bin/printf '\0' | wc -c
>        1
>
>
> > however my solution still stays
> > you just use memory locations instead of c strings
> > and those entries in memory are of course of known length, before setting
> > and all is fine
>
> "Your" solution is decades old.  Everyone knows how Pascal-style
> strings work.  This is not cutting-edge computer science.

i dunno what pascal strings are, sorry

> > of course this means to not use these fauly 'c strings', but a self
> > coded solution
>
> As Greg already mentioned, such a system requires converting back
> to C strings for system calls and other external APIs.  It's not
> insurmountable, but it's more involved than just swapping all your
> char * to my_string or whatever

hard work this way i see
sorry, thanks.
>
> I repeat:
>
> >> It's so simple that you should have no problem converting the entire
> >> bash codebase to Pascal-style strings yourself.  We'll wait.
>
>
> --
> vq



reply via email to

[Prev in Thread] Current Thread [Next in Thread]