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 07:26:13 +0100

On Mon, Feb 7, 2022 at 6:19 AM Lawrence Velázquez <vq@larryv.me> wrote:
>
> On Sun, Feb 6, 2022, at 11:53 PM, Alex fxmbsw7 Ratchev wrote:
> > On Mon, Feb 7, 2022 at 12:02 AM Greg Wooledge <greg@wooledge.org> wrote:
> >> There are other programming languages besides bash.  Some of them can
> >> store NUL bytes internally, either by encoding and decoding them on the
> >> fly, or by not using C-style strings internally (which means any system
> >> calls require encoding/decoding the internal strings to C-style strings).
> >
> > i am not sure, but, tell me
> > 'c strings' is a problem due to internal function handling with static \0 
> > eof
> > while 'c strings' can store null bytes no ? ( tell me if this is true
> > or not plz )
>
> It is not true.  C strings are terminated by NUL.

well i saw now, printf a char of "\0" results in 0 bytes out to wc -c

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

i mean
you have 3 strings, "abc" "\0\0\0" and "something" again
you wanna store those, you know those, they length, to map em with an
index of length to memory
and access em therefore
they must be in some memory cluster that can expand of course

how to try to explain
you read 3 bytes abc u map em, u read 3 bytes 0 u map em, and so they
also can be accessed

of course this means to not use these fauly 'c strings', but a self
coded solution
i must do one, next thing when i get to .c
cause i __do not__ wanna miss \0's

> > then if, its up to the coding buddies to self code
>
> How generous of you to volunteer other people's time and effort.
>
>
> > its so simple:
> > you have always static length strings simply, u conunt and know the
> > length of every msg used, and so u can separate right
> > isnt it so simple ?
>
> It's so simple that you should have no problem converting the entire
> bash codebase to Pascal-style strings yourself.  We'll wait.
>
>
> >> I urge you to learn one of these other languages, and use it.
> >
> > i cant read others docs it seems buddy, it budds mee, its like the web
> > docs about shell scripting, as you i and i wrote on our pages, its
> > very invalid
> > and so i cant learn a new language sorry
>
> Tragic.
>
>
> --
> vq



reply via email to

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