aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
AgeCommit message (Collapse)Author
2014-08-02Unbreak find -exec.Rob Landley
2014-07-30find.c: fix -iname.Rob Landley
2014-07-29find.c: first pass at case case insensitivity and exec. (Needs more debugging.)Rob Landley
2014-07-26Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still ↵Rob Landley
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
2014-07-20Don't go into an endless loop if we hit a bad utf8 sequence without -q.Rob Landley
2014-07-20Add utf8 support to ls -C.Rob Landley
Use wcwidth() instead of strlen(), and extend the -q substitution to also whiteout nonprintable characters that are nonparseable utf8 snippets.
2014-07-18Find bugfixes.Rob Landley
The check for -print vs -print0 was tested before I optimized out the "-" in the strcmps, and I didn't adjust the offset or retest it. (Ooops.) Also, I wasn't clearing the ! value when descending into parentheticals, so "find . -name blah -o \! \( -stuff -o -thing \)" acted like it had a spurious second ! before -stuff inside the parentheses.
2014-07-16Write a new find. Not quite done, but the basics work.Rob Landley
2014-07-14Implement -HL for cp.Rob Landley
2014-07-06Promote killall5 by merging it into kill.Rob Landley
Slight conflict here: this puts killall5 in the posix directory. But the commands sharing code trumps that.
2014-07-03date -r wasn't saving the result in the right variable. (And make date -ur ↵Rob Landley
work.)
2014-07-03Fix rm -rf of chmod 000 directories.Rob Landley
2014-06-28Use dlist_terminate() in patch.Rob Landley
2014-06-28Add : as an alias for true (toysh needs this).Rob Landley
2014-06-11Option parsing for nohup needs to stop at first nonoption argument. Minor ↵Rob Landley
cleanups.
2014-06-11Promote strings.Rob Landley
2014-06-09When locale is enabled, sprintf("%.123s", str) is counting characters, not ↵Rob Landley
bytes, so we can't globally enable locale without opening stack/heap smashing vulnerabilities. Make commands individually request setlocale() using TOYFLAGS instead.
2014-06-02Help text should have a blank line after usage: lines, and a couple other ↵Rob Landley
whitespace tweaks.
2014-06-01cpio: archive more filesIsaac Dunham
While writing tests for cpio, I found that cpio tries to open empty files if they're regular files, and fails to archive them if unreadable. This can be easily avoided, and is not the usual behavior.
2014-05-31Introduce xfork() and make commands use it, and make some WEXITSTATUS() use ↵Rob Landley
WIFEXITED() and WTERMSIG()+127.
2014-05-29Switch mtab_list to doubly linked so we can traverse in either order. ↵Rob Landley
Convert umount and df. Add dlist_terminate() to break lists for traversal in either direction.
2014-05-25logname and whoami are the same as id -un, so merge them.Isaac Dunham
Since the starting letters are greater than those for 'id' or 'groups', we cn just check if the first letter is greater than 'i'.
2014-05-24Remove debug detritus I didn't mean to to check in, and treat an "this ↵Rob Landley
variable can never actually be used uninitialized but gcc's warning generator can't tell and fails spamwards" warning.
2014-05-22date: add -ds, document +FORMAT escapes.Rob Landley
2014-05-06Switch human_readable() to just outputing decimal kilo/mega/gigabytes, make ↵Rob Landley
du use it, move it from lib/pending.c to lib.c.
2014-04-29Teach cpio to set uid/gid and timestamp. (Timestamp has year 2100 problem.)Rob Landley
Note that directory timestamps are still sometimes wrong because creating things in a directory can update the timestamp. Also, cp -r has logic to ensure we can write to a directory that doesn't have write permission, cpio does not. This is fixable, but not what existing cpio does.
2014-04-25Fix od bug reported by Samuel Holland ("od -v -b" was appending default ↵Rob Landley
output type even though an output type was specified).
2014-04-16Revert lots of half-finished local debris I didn't mean to check in with ↵Rob Landley
Isaac's roadmap update. Mercurial's "import" command is still broken, committing local tree changes to files that weren't even touched by the patch because the hg developers inisist, when I point out how stupid it is, that they meant to do that. (hg record can do hunks, but import can't even track _files_.)
2014-04-12roadmap: describe glibc commands.Isaac Dunham
Some glibc commands are irrelevant because they're for functionality that is excluded from musl (mtrace, rpc*, localedef, iconvconfig, nscd). getconf and catchsegv look like candidates for the development toolchain; locale and iconv were already triaged. getent is pretty lame, but it and the timezone stuff (tzselect zic zdump) are the only new possibly interesting commands.
2014-04-10Fix date setting, and fluff out help text a bit.Rob Landley
2014-03-29Group headers by standard (POSIX or LSB) or function (internationalization, ↵Rob Landley
networking). Move headers standards ignore (but which have been there >15 years) to lib/portability.h. Fold xregcomp into lib since it's posix.
2014-03-27Fix cpio -it: don't close(fd) unless we opened it.Isaac Dunham
2014-03-26More cpio bugfixes from Isaac Dunham.Rob Landley
Fix FLAG_o to actually be 1 like the comment says, don't try to strlen(name) before reading it, pad TRAILER!!! entry correctly.
2014-03-25Promote cpio out of pending.Rob Landley
After some waffling I put it in "posix", even though it was last specified in susv2 (where it was the obsolete 6 byte header entries predating susv4). LSB specifies it, including the 8 byte header fields, but for the actual command it just references SUSv2. (LSB isn't so much a standard as Red Hat's "notes to self".)
2014-03-16Clarify an unclear comment pointed out by Steve Long.Rob Landley
2014-03-11Move mkpathat to lib, remove redundant function used by patch.Rob Landley
2014-03-11Factor out mkpathat.Rob Landley
2014-02-22Add -H option to cksum (hex output), fix to use FLAG macros.Rob Landley
2014-02-04Tweak help text.Rob Landley
2014-01-29More elaborate help text collating logic.Rob Landley
2014-01-16Rename xmsprintf() to just xmprintf().Rob Landley
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.
2013-12-29Add -zZ support to grep (NUL delimited input/output).Rob Landley
2013-12-27Pass through all the readfile() arguments from xreadfile().Rob Landley
2013-12-18ln -v support from Ashwini Sharma (comment tweak from me)Rob Landley
2013-12-18Ashwini Sharma added -v, I tweaked it a bit and added a couple test suite ↵Rob Landley
entries.
2013-12-08Can't test <0 on an unsigned, reported by Nathan McSween.Rob Landley
2013-12-03Redo od whitespace with multiple output types so the columns align.Rob Landley
Factor out single output type into od_out_t(), call it in a loop for each type finding largest output (and if output consumes more than one byte of input average rounding up), pad each output to the largest output times number of bytes input consumed.
2013-11-30Fix cut.Rob Landley
Some commands went in before "pending", and thus need cleanup but are enabled in defconfig. The fact cut used a function out of lib/pending.c is a hint it might be in this category...
2013-11-28Add xgetpwnam() to lib/xwrap.c.Rob Landley
2013-11-28Move xgetpwuid() and xgetgrgid() into xwrap.cRob Landley