aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/grep.c
AgeCommit message (Collapse)Author
2016-02-10Although printf("%.*s", INT_MAX, s) works fine on ubuntu 12.04, it broke since.Rob Landley
2016-02-04Fix -H and -n with -ABC, and add tests.Rob Landley
2016-01-30Add grep -B -CRob Landley
2016-01-30Add grep -ARob Landley
2016-01-05Add error_msg_raw() and friends, replace error_msg("%s", s) uses, enable formatRob Landley
checking, and fix up format checking complaints. Added out(type, value) function to stat to avoid a zillion printf typecasts.
2015-11-01Change grep -w to checking matches after the fact rather than modifing regex.Rob Landley
This lets '(x)\1' match, as reported by Isabella Parakiss.
2015-06-06Last grep commit broke non -r use of grep. Oops.Rob Landley
2015-05-20Make "grep -r regex" work on implicit "." if no files specified.Rob Landley
2015-02-14Make egrep and fgrep build standalone.Rob Landley
2014-12-31Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag ↵Rob Landley
macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags). This means the flag space is no longer packed, but leaves gaps where the zeroes go. (Actual flag bit positions are the same for all configs.) Since the option parsing needs to know where the holes are, the OPTSTR values are now generated as part of flags.h with ascii 1 values for the disabled values. (So generated/oldflags.h went away.) This also means that the option string argument for OLDTOY() went away, it now uses the same arguments as the NEWTOY() it references.
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.
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-11-09grep doesn't allocate enough spaceWilliam Haddon
Grep miscalculates the amount of memory it needs to allocate when "converting strings to one big regex" when the -e flag is not specified. Since in this case "\|" is inserted between strings rather than "|", two extra bytes rather than one need to be provided for each string. I noticed this because it caused grep to seg-fault on musl when a regex of exactly seven characters is provided.
2013-08-21Fix bug where exit code was only correct for -q.Rob Landley
2013-08-19Move grep from pending to posix, switch default to y.Rob Landley