Out of curiousity, what kind of bug was it in terms of what was
happening to the memory?

Out of bounds access. The -r option code does "array[i-1]", and i may be
zero when the key block is empty, which should never happen but was not
properly checked. So your use case triggered "array[(unsigned int)-1]",
which hits a place in memory it definitely should not. :)

Also, in the above example, I would like to feed a three word input
(string or line in regular terminology?) to the first multidefine, and
extract the two of the words out of $msg with the second multidefine,
but it gives me an unquoted argument error. What am I doing wrong, or
what's the correct way to do this? I am stuck...

 You only need one invocation.

pipeline { echo one two three }
withstdinas -n line
importas -u line line
multidefine $line { cmd key val }
echo $key $val

 will print "two three".


Reply via email to