| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Reviewed by: schweikh (mentor)
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
regular expression as the first argument to a substitute command. If
used to test a sed which (erroneously) evaluates this at translation
time rather than at execution time, the bugged sed is put into an
infinite loop. This mode of failure seems excessive. Such a failing
sed is the Free Software Foundation's sed 3.02.
The specific test was also not being executed for the BSD sed.
Both problems are now fixed.
PR: misc/25585
Submitted by: Walter Briscoe <w.briscoe@ponl.com>
Approved by: schweikh (mentor)
MFC after: 2 weeks
|
|
|
|
|
|
|
|
| |
whose true and false clauses were equivalent with a check that we are
not about to stumble off the end of the line.
Reported by: peter
Pointy hat to: fanf
|
|
|
|
|
|
|
|
|
| |
There are two bugs: in the s///g case, the substitution didn't occur
at the end of the line; in the s///N case, the code didn't count
forwards along the line properly. See the sg, s3, s4, and s5 tests
in src/tools/regression/usr.bin/sed/.
Reviewed by: tjr
|
|
|
|
| |
especially in troff files.
|
|
|
|
| |
Approved by: re
|
|
|
|
| |
Sponsored by: Apple
|
|
|
|
|
|
|
|
| |
line of the pattern space is empty. Don't emit spurious newline when
EOF is reached with the `N' command.
Pointed out by: Oleg Osyka
MFC after: 1 week
|
|
|
|
|
|
|
|
| |
(1) errors from freopen were not reported correctly
(2) large files were not handled correctly
(3) read-only files broke things
MFC after: 1 week
|
|
|
|
| |
Obtained from: NetBSD (kleink, Aymeric Vincent)
|
| |
|
| |
|
|
|
|
| |
doesn't actually use the buffer when errbuf_size == 0, pass NULL.
|
| |
|
|
|
|
|
|
| |
initial setup anymore (since process.c rev. 1.25). Add $FreeBSD$.
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
| |
need to know. Instead, check when we are trying to match a "$" address.
This does not change the way sed processes regular files, but makes it behave
more sensibly when used interactively.
PR: 40101
MFC after: 2 weeks
|
|
|
|
|
|
| |
hold space is null; some functions assume it's never null.
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
of the pattern space not to be examined.
Noticed by: Motoyuki Konno <motoyuki@bsdclub.org>
|
|
|
|
| |
command's output so it's the same as what SUSv3 specifies.
|
|
|
|
|
|
|
|
| |
instead add the newline when the pattern space is printed. Make the `G' and
`H' commands add a newline to the space before the data, remove bogus
addition of newline from `x' command.
PR: 29790, 38195
|
| |
|
|
|
|
| |
input space in mf_fgets() if we reach the end of all input files.
|
|
|
|
| |
broken by rev. 1.22.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- original version of code worked incorrectly when more than one
input files were specified - it was moving the last line from the 1st file
to be the first line of the 2nd, last line of the 2nd to be the first
line of the 3rd and so on;
- use mmap()->write() to create temporary file instead of
malloc()->read()->write(), which was not only slower, but also did not
bother to free allocated memory once backup file was created, potentially
leading to memory exhausting when regex is applied to a big file or a large
number of small ones.
|
|
|
|
| |
in-line. Document effects of locale environment variables in the same way.
|
|
|
|
| |
for a very long time (or never did exist).
|
| |
|
| |
|
|
|
|
|
| |
EOL anchor, when the last input line does not end in a newline character.
Picked up by the GNU sed test suite.
|
| |
|
|
|
|
| |
variable (SUSv3)
|
| |
|
|
|
|
|
|
|
| |
was initiated at the last character of the line buffer, the Wrong
Thing was done and sed barfed by interpreting the following NUL byte
as a digit. Instead, pull up the next buffer and record that the "\"
was last seen.
|
| |
|
|
|
|
| |
and exit non-zero (SUSv3)
|
| |
|
|
|
|
|
|
|
| |
mktemp(3). It would be amazingly unlikely, but the former method
could result in a symlink attack. A better solution would use
${TMPDIR}, though.
o Make sed not overwrite old backup files with no warning.
|
| |
|
|
|
|
| |
Add a note that this is kinda-sorta dangerous to the manual page.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Perl for such things. The key difference to Perl is that a backup extension
*MUST* be specified, because on one hand it isn't recommended to have options
which optionally take a parameter, and on the other hand, it'd be slightly
unpleasent to implement proper handling for that.
The difference between this and the version posted to developers@ is that it
does handle multiple files in argv after the getopt(3) handling "correctly",
in that the inplace editing-specific code has been moved out to a function,
and that function is used beyond the first file in our linked list.
This option has been documented as FreeBSD-specific in the manpage.
Reviewed by: developers@ (got feedback from: des, fanf, sobomax, roberto,
obrien)
MFC after: 1 week
|
|
|
|
|
|
| |
PR: docs/37287
Submitted by: Tony Finch <dot@dotat.at>
MFC after: 3 days
|
|
|
|
|
|
|
|
| |
substitution expressions in the form `s,[fooexp],[barexp],;...' treated
as invalid when the third `,' is (_POSIX2_LINE_MAX * N)-th character in
the line.
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specified, and then the first part of the pattern space is deleted, when
there are two or more input lines, as this results in subtraction of one from
an unsigned integral value of '0'. That bogus value is used in one case
for a loop (that will run far too many times in this case) and a function to
search for a value within a specified range of memory, however now the range
of memory is obscenely large and a segmentation fault will occur. This is
fixed by checking for and appropriately handling a nil pattern space as if
the specified search in memory failed, as indeed it obviously will with nil
pattern space.
Submitted by: Tim J. Robbins <tim@robbins.dropbear.id.au>
PR: bin/34813
Reviewed by: mike
MFC after: 1 day
|
|
|
|
|
|
|
|
|
|
| |
contains a \n.
PR: misc/26153
Submitted by: ashp
Reviewed by: mike
Obtained from: NetBSD
MFC after: 2 days
|
| |
|
| |
|
|
|
|
| |
Use __FBSDID(), kill register keyword.
|
|
|
|
|
| |
PR: bin/11900
MFC after: 2 weeks
|