[PATCH] shell: fix $(()) precedence bug in "X=A?B:C" (it is _not_ "(X=A)?..)"

Steffen Nurpmeso steffen at sdaoden.eu
Thu Aug 18 23:10:06 UTC 2022


I just fixed two other bugs regarding $: ternary resolution which
affect strange cases regarding precedence in whiteouts

  $((0?I1=10:(1?I3:I2=12)))
  vs
  $((0?I1=10:(0?I3:I2=12)))

as well as a missing variable-expansion prevention in a whiteout.
(Let me allow to keep saying whiteout, please.)
It bugs me.  "Three line fix", so to say.
Locally i added a couple of more tests, and i am now really out of
ideas what other tests i could throw at the code.
Sorry again for now waiting until i had an iteration.

In the meantime i added a better PO-error tracking, too, via a third
stack that eventually gets used.  It also makes "error tracking"
entirely optional, ending with a constant error message only
without it.  I was planning to send a v3 with a new configuration
option that selects this when i stumbled over the in-whiteout
errors.

I will send the small bugfix patch onto v2 tomorrow, and then also
a brand new one-commit v3 patch with the configuration option and
my current code.  It will also move most of the compat shims into
shexp-arith.h, but is still also not a fully busybox integrated
thing.

I hope these threads then fall silent.
Ciao.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the busybox mailing list