aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/sed
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix regression with /i caused by r303047Enji Cooper2016-07-311-1/+5
| | | | | | | | | | | | | | | | | | | '\n' was specifically added to -e arguments prior to r303047. Restore historical behavior which in turn fixes usr.sbin/etcupdate/preworld_test:main . The fix is being committed to address the issue in the short term and may be iterated upon as noted in bug 211399 Discussed with: mi, pfg Differential Revision: https://reviews.freebsd.org/D7368 PR: 195929, 211399 [*] MFC after: 18 days X-MFC with: r303047 Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303572
* Explicitly test for cu_fgets returning NULL or !NULLEnji Cooper2016-07-301-2/+2
| | | | | | | | MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303538
* Remove usage of _WITH_GETLINE from usr.binBaptiste Daroussin2016-07-301-1/+0
| | | | Notes: svn path=/head/; revision=303526
* Don't call basename() and dirname() in an unportable way.Ed Schouten2016-07-281-2/+8
| | | | | | | | | POSIX allows these functions to modify their input buffer, so that they have storage for the return value. Pull copies of the filename before calling these utility functions. Notes: svn path=/head/; revision=303443
* Testcase 7.8 no longer needs to be marked TODOEnji Cooper2016-07-271-1/+0
| | | | | | | | | | It passes out of the box today MFC after: 2 months Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303367
* sed(1): Appease older GCC.Pedro F. Giffuni2016-07-211-1/+2
| | | | Notes: svn path=/head/; revision=303146
* sed(1): Assorted cleanups and simplifications.Pedro F. Giffuni2016-07-197-193/+174
| | | | | | | | | | | Const-ify several variables, make it build cleanly with WARNS level 5. Submitted by: mi PR: 195929 MFC after: 1 month Notes: svn path=/head/; revision=303047
* sed(1): Fix off by one introduced in r299211.Pedro F. Giffuni2016-07-171-1/+1
| | | | | | | | | | | Detected by running the gsed tests. Submitted by: Mikhail Teterin PR: 195929 MFC after: 3 days Notes: svn path=/head/; revision=302973
* sed(1): Fix a mismatch and sync with the OpenBSD's commit.Pedro F. Giffuni2016-06-011-5/+6
| | | | | | | | | | This was causing some strange behaviour. Reported by: olivier Obtained from: OpenBSD (CVS rev. 1.28) Notes: svn path=/head/; revision=301138
* sed: convert sed to use REG_STARTEND more explicitly.Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=300684
* sed.1: Correction for the case insensitive case.Pedro F. Giffuni2016-05-101-2/+2
| | | | | | | | | | | Use the capital I instead of the lowercase. Submitted by: Mikhail T. PR: 195929 MFC after: 2 weeks Notes: svn path=/head/; revision=299377
* Revert r299279:Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=299294
* Simplify redundant malloc'ing in sed -e.Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=299279
* sed: rewrite the main loop.Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=299211
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-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 Notes: svn path=/head/; revision=299094
* kernel: use our nitems() macro when it is available through param.h.Pedro F. Giffuni2016-04-211-5/+5
| | | | | | | | | No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current Notes: svn path=/head/; revision=298440
* MFHGlen Barber2016-04-061-2/+1
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=297605
| * Fix sed functions 'i' and 'a' from discarding leading white space.Pedro F. Giffuni2016-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This appears to be implementation dependent but convenient and makes our sed behave more like GNU sed. Given that it is not the historic behavior, bump FreeBSD_version should userland/ports somehow depend on it. Obtained from: NetBSD (bin/49872) Reviewed by: bdrewery PR: 208554 Merge after: NEVER Notes: svn path=/head/; revision=297602
* | MFHGlen Barber2016-03-102-0/+22
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-092-0/+22
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | First pass to fix the 'tests' packages.Glen Barber2016-02-022-0/+7
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* Fix a ton of speelling errorsEitan Adler2015-10-211-1/+1
| | | | | | | | | | arc lint is helpful Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com Differential Revision: https://reviews.freebsd.org/D3337 Notes: svn path=/head/; revision=289677
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andEnji Cooper2015-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 Notes: svn path=/head/; revision=289172
* Add META_MODE support.Simon J. Gerraty2015-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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-275-10/+19
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-194-26/+87
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-192-9/+16
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ \ \ Merge headSimon J. Gerraty2014-04-28162-3/+5748
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ \ \ \ Merge from headSimon J. Gerraty2013-09-051-8/+11
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | | | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | | sed: fix pasto from previous r277802.Pedro F. Giffuni2015-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=277811
* | | | | | | Fix resource leak and dereference after NULL.Pedro F. Giffuni2015-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 Notes: svn path=/head/; revision=277802
* | | | | | | Replace __inline GNUism with the standard inline.Pedro F. Giffuni2015-01-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=277099
* | | | | | | Add a regression test for PR 192108.Jeremie Le Hen2015-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 Notes: svn path=/head/; revision=276909
* | | | | | | Partial revert of r276832:Pedro F. Giffuni2015-01-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not bump the warns level as it still breaks the gcc build on sparc64 Reported by: jenkins Notes: svn path=/head/; revision=276837
* | | | | | | sed: Address warnings with clang and gcc48.Pedro F. Giffuni2015-01-083-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=276832
* | | | | | | sed: Bounds check the file path used in the 'w' command.Pedro F. Giffuni2014-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 Notes: svn path=/head/; revision=275838
* | | | | | sed(1): Don't force a newline on last line, if input stream doesn't have oneJean-Sébastien Pédron2014-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 Notes: svn path=/head/; revision=269729
* | | | | | Fix relative numerical addressing (addr,+N).Jeremie Le Hen2014-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 Notes: svn path=/head/; revision=269302
* | | | | More sed(1) usage fixing: the extension -i is not optional.Pedro F. Giffuni2014-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pointed out by: jmallet MFC after: 3 days Notes: svn path=/head/; revision=268203
* | | | | Fix sed(1) usage: the extension -i is not an optional.Pedro F. Giffuni2014-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=268193
* | | | | use .Mt to mark up email addresses consistently (part3)Baptiste Daroussin2014-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de> Notes: svn path=/head/; revision=267773
* | | | | Drop ifdef nonsense: just use setvbuf(3).Pedro F. Giffuni2014-06-211-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pointed out by: kib, bde Notes: svn path=/head/; revision=267703
* | | | | Add -u (unbuffered output) after GNU sed.Pedro F. Giffuni2014-06-202-6/+19
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=267692