Age | Commit message (Collapse) | Author |
|
|
|
|
|
I realized (after being questioned about my motivation) that I hadn't
added a test for the -u behavior. Adding the missing test confirmed the
usual "if there isn't a test, the code is broken", but now I think I
actually understand how we're supposed to choose between DIR, $TMPDIR,
and /tmp. I've added more tests to back this up, and rewritten the code
one more time so that we pass all the tests.
|
|
Old versions of glibc had warn_unused_result on mktemp(3), despite it
always returning its argument. Still, we can silence the warning and
save a line, so...
|
|
The new tests pass on the host (coreutils 8.28) and with toybox after
this patch is applied.
|
|
|
|
"mktemp -u > /dev/full" leave file around.
|
|
The -u flag creates a file, and unlinks it before exiting.
This is usually known as "unsafe mode", or "dry-run" mode.
GNU mktemp has it, as does Busybox's mktemp and likely many others.
|
|
|
|
Also, xstrdup() the unmodified template because changing the environment string
could make the changed version show up in "ps".
|
|
|
|
|
|
|
|
Include full template in error messages.
Don't report success on failure with -q.
Avoid unnecessary allocation.
Fix "xxxxxx" versus "XXXXXX" confusion.
|
|
Partly because there's no supplied target string ala sprintf, and partly
because I can never remember what order the m and s go in.
|
|
right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
The actual code should be the same afterward, this is just cosmetic refactoring.
|
|
FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
|
|
/tmp/tmp.* Specify a file, ./file. Specify -p dir then dir/tmp.*. Specify -p dir and file, dir/file. Also implement -q which lsb wants.
|
|
|
|
|