[Toybox] tar tests.

Rob Landley rob at landley.net
Wed Mar 20 08:23:07 PDT 2019


On 3/19/19 2:39 PM, Rob Landley wrote:
> So what it's doing is filling out 6 digits (with zero padding on the left if
> it's short!) and then sticking a space in the last byte.
> 
> *shrug* I can do that. It's silly, but I can do it.

getline() gives me the newline at the end of the tar pattern name as part of the
stream, so if I feed the array of command line arguments _and_ the do_lines()
strings into the same function, you won't be able to specify a filename with a
trailing \n on the command line.

I think that's ok because the shell is already trimming those? (Even echo
"$(echo -e 'hello\n\n\n\n\n')" will trim _all_ the trailing \n off an argument
because shell.) but it's a limitation I'm not entirely comfortable with, _and_
it means that exec("tar") has the same limit the shell does. (The two characters
you _can't_ have in a filename are / and NUL, you can totally have \n in a
filename including at the end. And this is why we have wildcards for rm...)

Hmmm...

Rob



More information about the Toybox mailing list