redo
redo copied to clipboard
Re-implement rc_splitwords to accommodate arbitrarily many words
Tested with zsh, bash, dash, ash (busybox) and /bin/sh pointing to bash. Test patterns:
rc_splitwords '"a b"' "'c d'" 'e\ f' "g\ h" i\\\ j
rc_splitwords $(seq 10000)
rc_splitwords "$(seq 10000)"
For the long sequence tests, performance was still a sub-second response with bash being considerably slower than the other shells.
As a side note: I object to the suppression of empty arguments, as these might be valid input, but kept it for compatibility.
Ping.