Il giorno ven 20 ago 2021 alle ore 15:21 Harald van Dijk <har...@gigawatt.nl> ha scritto:
> On 20/08/2021 13:48, Roberto A. Foglietta wrote: > > > > Il giorno ven 20 ago 2021 alle ore 14:05 Harald van Dijk > > <har...@gigawatt.nl <mailto:har...@gigawatt.nl>> ha scritto: > > > > Hi, > > > > Replying to the new thread as requested. > > > > About the global LINENO: having thought about it more, I don't think > it > > makes sense to special-case trap actions. This is something that > should > > be done for all evalstring() calls that are performed when an outer > > context has already set LINENO. In the busybox version of ash, there > is > > only one other such case: the eval command. > > > > > > Hi Harald, > > > > thank you for your consideration. I did a patch that satisfies your > case. > > The test suite is in attachment also because it is updated with the > > new case. > > Hi, > > Please note the "when an outer context has already set LINENO" > qualification :) busybox does have one call to evalstring() when no > outer context has set LINENO to be preserved (and a prior context might > have set it to an unrelated value that should be discarded): that > happens when processing the command string supplied with the -c command > line option. In that case, it is probably best to let LINENO start at 1 > from the start of the command string like busybox ash currently does. > Hi, it is a matter of convention: external commands strings could have lineno 0 or 1. The patch attached simply changes the initialisation value. As you wish or like. IMHO, the value 0 informs that LINENO has no meaning: it is more informative. === BEFORE === src/busybox ash -c "echo LINENO here is \$LINENO called on $LINENO" ash: using fallback suid method LINENO here is 0 called on 251 === AFTER === src/busybox ash -c "echo LINENO here is \$LINENO called on $LINENO" ash: using fallback suid method LINENO here is 1 called on 256 Best regards -- Roberto A. Foglietta +39.349.33.30.697
busybox-1.33.1-LINENO-initialised-to-1.patch
Description: Binary data
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox