summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
Commit message (Collapse)AuthorAgeFilesLines
* MFC r312521,r313397:ngie2017-07-192-0/+60
| | | | | | | | | | | | | | | | r312521: Add testcases for -i with hardlinks and symlinks The symlink testcase is expected to fail, post-r312519 (the revert of r312404); mark it so. r313397: Don't expect :inplace_symlink_src to fail anymore (post-r313277) The S_ISREG check was restored, such that the code will again fail with in-place replacements on symlinks
* MFC r316030, r317378: Add some useful examples to the sed man page.brd2017-05-231-1/+31
| | | | | Reviewed by: wblock, bcr Differential Revision: https://reviews.freebsd.org/D9958
* MFC r312404, r312519, r313277:delphij2017-04-031-1/+1
| | | | | | | | Use S_ISREG instead of manual & (also it's better to compare the result from & and the pattern instead of just assuming it's one bit value). Pointed out by Tianjie Mao <tjmao tjmao com>.
* MFC r312520:ngie2017-02-101-0/+5
| | | | | | | Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test suite as usr.bin/sed/sed_test Don't expect :emptybackref to fail -- it succeeds on FreeBSD
* MFC r308314:pfg2016-11-091-0/+3
| | | | | | | | | | | | | | | sed(1): add LEGACY_BSDSED_COMPAT compile-time flag. In r297602, which included a __FreeBSD_version bump to 1100105, we changed sed 'i' and 'a' from discarding whitespaces to conform with what GNU and sysvish sed do. There are arguments in favor of keeping the old behavior but the new behavior is also useful for migration purposes. It seems important to at least consider the case of developers depending on the previous behavior so add a CFLAG to enable the old behavior. PR: 213474
* MFC r303367:ngie2016-10-211-1/+0
| | | | | | Testcase 7.8 no longer needs to be marked TODO It passes out of the box today
* MFC r302973:pfg2016-07-201-1/+1
| | | | | | | | | | sed(1): Fix off by one introduced in r299211. Detected by running the gsed tests. Submitted by: Mikhail Teterin PR: 195929 Approved by: re (gjb)
* sed(1): Fix a mismatch and sync with the OpenBSD's commit.pfg2016-06-011-5/+6
| | | | | | | This was causing some strange behaviour. Reported by: olivier Obtained from: OpenBSD (CVS rev. 1.28)
* sed: convert sed to use REG_STARTEND more explicitly.pfg2016-05-251-16/+22
| | | | | | | | | | | | | | | Summarizing the findings in the OpenBSD list: This solves a reproduceable issue with very recent Mesa where REG_NOTBOL combined with a match at the begin of the string causes our regex library to treat the word as not begin of word. Thanks to Martijn van Duren and Ingo Schwarze for taking the time to solve this in the least invasive way. PR: 209352, 209387 Taken from: openbsd-tech (Martijn van Duren) MFC after: 1 month
* sed.1: Correction for the case insensitive case.pfg2016-05-101-2/+2
| | | | | | | | Use the capital I instead of the lowercase. Submitted by: Mikhail T. PR: 195929 MFC after: 2 weeks
* Revert r299279:pfg2016-05-101-1/+6
| | | | | | | | | | | | | | | | | Simplify redundant malloc'ing in sed -e. It is causing havoc in the ports tree: ===> Configuring for wxsvg-1.5.7 sed: 1: "/gcc_dir=\\`/s/gcc /$CC /": bad flag in substitute command: '/' *** Error code 1 ===> Patching for vips-8.3.1 sed: 1: "1s|^#![[:space:]]*/usr/ ...": bad flag in substitute command: 's' *** Error code 1 PR: 195929 Reported by: danilo
* Simplify redundant malloc'ing in sed -e.pfg2016-05-091-6/+1
| | | | | | | | | | | | | | When encountering an -e argument, sed currently mallocs a string to COPY the optarg -- with '\n' appended. The appendage does not seem necessary -- indeed, the same call to add_compunit processing the sole command (given without -e) passes the *argv verbatim: without making a copy, and without appending newline. This matches what is done in other BSDs. Submitted by: Mikhail T. PR: 195929 MFC after: 2 weeks
* sed: rewrite the main loop.pfg2016-05-071-49/+43
| | | | | | | | | | | Rewrite the main loop of the "sed s/..." command, shortening it by ten lines and simplifying it by removing the switch statement implementing /g, /1, and /2 separately and repetitively. This will be needed to bring a fix from OpenBSD later. Obtained from: OpenBSD (schwarze CVS Rev. 1.18) MFC after: 3 weeks
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-042-160/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* kernel: use our nitems() macro when it is available through param.h.pfg2016-04-211-5/+5
| | | | | | No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current
* MFHgjb2016-04-061-2/+1
| | | | Sponsored by: The FreeBSD Foundation
* MFHgjb2016-03-102-0/+22
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-092-0/+22
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | First pass to fix the 'tests' packages.gjb2016-02-022-0/+7
|/ | | | Sponsored by: The FreeBSD Foundation
* Fix a ton of speelling errorseadler2015-10-211-1/+1
| | | | | | | arc lint is helpful Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com Differential Revision: https://reviews.freebsd.org/D3337
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-121-2/+0
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* Add META_MODE support.sjg2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-275-10/+19
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-194-26/+87
| |\
| * \ Merge head from 7/28sjg2014-08-192-9/+16
| |\ \
| * | | Updated dependenciessjg2014-05-161-1/+0
| | | |
| * | | Updated dependenciessjg2014-05-101-0/+2
| | | |
| * | | Merge from headsjg2014-05-081-1/+1
| |\ \ \
| * \ \ \ Merge headsjg2014-04-28162-3/+5748
| |\ \ \ \
| * \ \ \ \ Merge from headsjg2013-09-051-8/+11
| |\ \ \ \ \
| * | | | | | Updated dependenciessjg2013-03-111-0/+1
| | | | | | |
| * | | | | | Updated dependenciessjg2013-02-161-2/+0
| | | | | | |
| * | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | | sed: fix pasto from previous r277802.pfg2015-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 3 days
* | | | | | | Fix resource leak and dereference after NULL.pfg2015-01-272-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | process.c: Protect access against NULL. main.c: Prevent outfile overwrite resource leak. CID: 271181 CID: 1006930 Obtained from: NetBSD MFC after: 3 days
* | | | | | | Replace __inline GNUism with the standard inline.pfg2015-01-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week
* | | | | | | Add a regression test for PR 192108.jlh2015-01-102-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I won't go through the hassle of MFCing it since I expect all changes to go first through HEAD anyway. PR: 192108
* | | | | | | Partial revert of r276832:pfg2015-01-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not bump the warns level as it still breaks the gcc build on sparc64 Reported by: jenkins
* | | | | | | sed: Address warnings with clang and gcc48.pfg2015-01-083-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 2 weeks
* | | | | | | sed: Bounds check the file path used in the 'w' command.pfg2014-12-161-1/+4
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified version of a diff from Sebastien Marie to prevent a crash found with the afl fuzzer. Obtained from: OpenBSD (CVS Rev. 1.37) MFC after: 1 week
* | | | | | sed(1): Don't force a newline on last line, if input stream doesn't have onedumbbell2014-08-084-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While here, change how we check if the current line is the last one. Before, we just checked if there were more files after the current one. Now, we check the actual content of those files: they files may not have a line at all. This matches the definition of the "last line" by the Open Group. The new behavior is closer to GNU sed. PR: 160745 Phabric: https://phabric.freebsd.org/D431 Reviewed by: jilles Approved by: jilles Exp-run by: antoine
* | | | | | Fix relative numerical addressing (addr,+N).jlh2014-07-301-18/+26
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a bonus the patch untangles a bit the logic and makes the code easier to grasp. PR: 192108 MFC after: 1 week
* | | | | More sed(1) usage fixing: the extension -i is not optional.pfg2014-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Pointed out by: jmallet MFC after: 3 days
* | | | | Fix sed(1) usage: the extension -i is not an optional.pfg2014-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | MFC after: 3 days
* | | | | use .Mt to mark up email addresses consistently (part3)bapt2014-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* | | | | Drop ifdef nonsense: just use setvbuf(3).pfg2014-06-211-9/+3
| | | | | | | | | | | | | | | | | | | | Pointed out by: kib, bde
* | | | | Add -u (unbuffered output) after GNU sed.pfg2014-06-202-6/+19
| |_|_|/ |/| | | | | | | | | | | | | | | Obtained from: NetBSD MFC after: 1 week
* | | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| |_|/ |/| | | | | | | | from the latter.
* | | Mark multi_test as requiring /usr/share/dict/words.jmmv2014-03-191-0/+1
| | | | | | | | | | | | The file may not be present if MK_DICT=no. Pointed out by Casey Peel.
OpenPOWER on IntegriCloud