Age | Commit message (Collapse) | Author | |
---|---|---|---|
2019-08-29 | diff and patch: support special characters in filenames with quoting as well ↵ | William Haddon | |
as unusual timestamp formats After further research and testing, I've produced a patch which handles all filenames with special characters by copying the GNU quoting behavior, and also treats anything following a tab as a timestamp. This increases both ability to handle possible filenames and ability to apply patches found in the field. In diff, quote and escape filenames according to the following rules. * Surround the filename with quotes if it contains a byte less than 0x20, a byte greater than or equal to 0x80, space, backslash, or quote. * Replace alert, backspace, form feed, newline, carriage return, tab, vertical tab, backslash, and quote with \a, \b, \f, \n, \r, \t, \v, \\, and \", respectively. * Replace other bytes less than 0x20 or greater than or equal to 0x80 with a backslash followed by the three octal digits representing the value of the byte. * Treat valid UTF-8 characters involving sequences of bytes greater than or equal to 0x80 the same as other sequences of such bytes. In patch, process quoted and escaped filenames according to the following rules. * If the filename does not begin with a quote, do not modify the filename. * Remove quotes surrounding the filename. * In quoted filenames, replace \a, \b, \f, \n, \r, \t, \v, \\, and \" with alert, backspace, form feed, newline, carriage return, tab, vertical tab, backslash, and quote, respectively. * In quoted filenames, replace a backslash followed by octal digits with the byte with that value in octal. Also, in patch, treat anything on a +++ or --- line following a tab character after the beginning of the filename as a timestamp, rather than part of the filename. | |||
2019-07-12 | diff: implement --strip-trailing-cr. | Elliott Hughes | |
Used by some ART tests and also some LLVM tests. (The motivating example is the latter, but I noticed the former when looking for other users.) Bug: http://b/137298656 | |||
2019-06-24 | diff: fix diff of stdin for systems without /tmp. | Elliott Hughes | |
xtempfile() alreay does the right thing, so switch to that. Also use xsendfile() for the actual copying. Fixes the cat tests on Android. | |||
2019-03-18 | diff: use TOYFLAG_ARGFAIL. | Elliott Hughes | |
This one with a little cleanup of unnecessary duplication. | |||
2018-07-13 | diff: fix build with -Wformat=security. | Elliott Hughes | |
The problem with testing changes on my desktop is that they won't always compile when I try to sync AOSP... | |||
2018-07-04 | diff: add timestamps to the ---/+++ lines and --color. | Elliott Hughes | |
(My apologies for mixing these two unrelated changes up.) | |||
2016-11-21 | Have dirtree_notdotdot() pass through !node->parent so . and .. on the command | Rob Landley | |
line aren't filtered out. Audited all the callers and removed redundant calls, adjusted call sequence, etc. (And let rm _not_ do this, because posix.) | |||
2016-04-14 | Fix a buffer overflow in diff -r. | Andy Chu | |
We were doing two 32-byte memset()s instead of two 16-byte memset()s. 'dir' referred to the instance (array of 2) and not the struct type. Add some test coverage for diff, including a case that hit this bug. The bug was found by running cp.test under AddressSanitizer, since it happens to use diff. | |||
2016-03-07 | Cleanup pass on the dirtree infrastructure, in preparation for making rm -r | Rob Landley | |
handle infinite depth. Fix docs, tweak dirtree_handle_callback() semantics, remove dirtree_start() and don't export dirtree_handle_callback(), instead offer dirtree_flagread(). (dirtree_read() is a wrapper around dirtree_flagread passing 0 for flags.) | |||
2015-05-09 | Add DIRTREE_SHUTUP to disable dirtree warnings if file vanishes out from | Rob Landley | |
under traversal. Pass through full flag set in dirtree_add_node(), add dirtree_start() wrapper to provide symlink-only behavior (avoiding a lot of DIRTREE_SYMFOLLOW*!!(logic) repeated in callers). | |||
2014-08-02 | Squash mix of tabs and spaces to just spaces. | Rob Landley | |
2014-08-02 | New toys unified DIFF and USERDEL. | Ashwini Sharma | |