#
b1b46280 |
| 02-Apr-2007 |
Yaroslav Tykhiy <ytykhiy@gmail.com> |
Prevent foot-shooting in advance: Put the MATCH() macro's value in parentheses. The ?: operator has a remarkably low precedence, so expressions like (MATCH(foo) && bar) would have an unexpected mea
Prevent foot-shooting in advance: Put the MATCH() macro's value in parentheses. The ?: operator has a remarkably low precedence, so expressions like (MATCH(foo) && bar) would have an unexpected meaning w/o the parentheses around MATCH().
Tested with: md5(1)
show more ...
|
#
6b8ef681 |
| 01-Apr-2007 |
Yaroslav Tykhiy <ytykhiy@gmail.com> |
This trivial change should fix at least 3 similar bugs. All of them are related to the `c' function's need to know if we are at the actual end of the address range. (It must print the text not earl
This trivial change should fix at least 3 similar bugs. All of them are related to the `c' function's need to know if we are at the actual end of the address range. (It must print the text not earlier than the whole pattern space was deleted.) It appears the only sed function with this requirement.
There is `lastaddr' set by applies(), which is to notify the `c' function, but it can't always help because it's false when we are hitting the end of file early. There is also a bug in applies() due to which `lastaddr' isn't set to true on degenerate ranges such as `$,$' or `N,$' if N appears the last line number.
Handling early EOF condition in applies() could look more logical, but it would effectively revert sed to the unreasonable behaviour rev. 1.26 of main.c fought against, as it would require lastline() be called for each line within each address range. So it's better to call lastline() only if needed by the `c' function.
Together with this change to sed go regression tests for the bugs fixed (c1-c3). A basic test of `c' (c0) is also added as it helped me to spot my own error.
Discussed with: dds Tested by: the regression tests MFC after: 1 week
show more ...
|
#
c691c0ed |
| 31-Mar-2007 |
Yaroslav Tykhiy <ytykhiy@gmail.com> |
Make the comment for cspace() match reality.
|
Revision tags: vendor/bzip2/1.0.4, vendor/netcat/4.1, vendor/acpica/20070320, vendor/openssl/0.9.8-20070315, vendor/openssl/0.9.8e, vendor/tcsh/6.15, vendor/bind9/9.3.4, vendor/ncurses/5.6-20061217, release/6.2.0_cvs, release/6.2.0, vendor/gdtoa/20050923, vendor/libreadline/5.2p1, vendor/libreadline/5.2, vendor/resolver/9.3.4, vendor/resolver/9.3.3, vendor/ath/0.9.20.3, vendor/bind9/9.3.3, vendor/pppd/2.3.11, vendor/openssh/4.5p1, vendor/bind9/9.3.2p2, vendor/resolver/9.3.3RC2, vendor/tzdata/tzdata2006n, vendor/openssl/0.9.8-20060929, vendor/openssl/0.9.8d, vendor/openssh/4.4p1, vendor/openbsm/1.0-ALPHA-12, vendor/openbsm/1.0-ALPHA-11, vendor/bind9/9.3.2p1, vendor/tcpdump/3.9.4, vendor/libpcap/0.9.4, vendor/openbsm/1.0-ALPHA-10, vendor/openbsm/1.0-ALPHA9-kwikfix_backout, vendor/NetBSD/lukemftpd/20060831, vendor/openbsm/1.0-ALPHA9-kwikfix, vendor/gcc/3.4.6-20060825-SVN116475, vendor/openbsm/1.0-ALPHA-9, vendor/gdb/6.1.1, vendor/less/v394, vendor/sendmail/8.13.8, vendor/ipfilter/4.1.13, vendor/ipfilter-sys/4-1-13, vendor/openssl/0.9.8b, vendor/libuwx/BETA10, vendor/openbsm/1.0-ALPHA-7, vendor/OpenBSD/cvs_20060501, vendor/file/4.17a, vendor/file/4.17, vendor/sendmail/8.13.7, vendor/binutils/2.15.NOTHING, vendor/ath/0.9.17.2, vendor/openbsm/1.0-ALPHA-6 |
|
#
85184b8b |
| 27-May-2006 |
Kirill Ponomarev <krion@FreeBSD.org> |
Fix using "P" command on empty pattern space. If the "P" command is used once on a non-empty pattern space and then again on an empty pattern space, the second usage restores the pattern space lengt
Fix using "P" command on empty pattern space. If the "P" command is used once on a non-empty pattern space and then again on an empty pattern space, the second usage restores the pattern space length to the length that it had when the first "P" was used.
PR: bin/96052 Submitted by: Andrey Zholos <aaz@althenia.net> MFC after: 7 days
show more ...
|
Revision tags: release/5.5.0_cvs, release/5.5.0, vendor/netcat/3.9, vendor/resolver/9.3.2, vendor/tzdata/tzdata2006g, release/6.1.0_cvs, release/6.1.0, vendor/libreadline/5.1p1-p4, vendor/libreadline/5.1, vendor/zlib/1.2.3, vendor/openssh/4.3p1, vendor/sendmail/8.13.6, vendor/csup/20060313, vendor/hostapd/0.4.8, vendor/wpa_supplicant/0.4.8, vendor/openbsm/1.0-ALPHA-5, vendor/csup/20060303, vendor/csup/20060302, vendor/bsnmp/1.12, vendor/tcsh/6.14, vendor/openbsm/1.0-ALPHA-4, vendor/ath/0.9.16.16, vendor/openbsm/1.0-ALPHA-3, vendor/openbsm/1.0-ALPHA-2, vendor/openbsm/1.0-ALPHA-1, vendor/bind9/9.3.2-dougb-p1, vendor/ipfilter/4.1.10, vendor/ipfilter-sys/4-1-10, vendor/bind9/9.3.2, vendor/tzdata/tzdata2005r, vendor/tzdata/tzdata2005q, vendor/nve/1.0.0310, release/6.0.0_cvs, release/6.0.0, vendor/acpica/20051021, vendor/acpica/20041119sysinc, vendor/wpa_supplicant/0.3-latest, vendor/groff/1.19.2, vendor/wpa_supplicant/0.3.9, vendor/bsnmp/1.11, vendor/misc-GNU/cpio/2.6, vendor/pf-sys/3.7.001, vendor/openssh/4.2p1, vendor/tzdata/tzdata2005m, vendor/tzdata/tzdata2005l, vendor/bind9/9.3.1p1, vendor/tcpdump/3.9.1, vendor/libpcap/0.9.1, vendor/openpam/FIGWORT, vendor/sendmail/8.13.4_1, vendor/hostapd/0.3.9, vendor/sendmail/8.13.4, vendor/OpenBSD/dhclient_openbsd_3_7, vendor/hostapd/0.3.7, vendor/wpa_supplicant/0.3.8, vendor/openssh/4.1p1, vendor/openssh/4.0p1, vendor/gcc/3.4.4-20050518, vendor/tcpdump/3.9.1-096, vendor/libpcap/0.9.1-096, vendor/ngatm/1.2, vendor/bsnmp/1.10, vendor/misc-GNU/texinfo/4.8, vendor/NetBSD/lukemftp/20050516, vendor/tnftp/20050516, vendor/one-true-awk/20050424, vendor/bzip2/1.0.3, vendor/libregex/fedora-glibc-2.3.4-21, release/5.4.0_cvs, release/5.4.0, vendor/NetBSD/regress_resolv_20050504, vendor/pf/3.7, vendor/pf-sys/3.7, vendor/bsnmp/1.9, vendor/ipfilter/4.1.8, vendor/ipfilter-sys/4-1-8, vendor/zlib/1.2.2 |
|
#
6c97c3d1 |
| 09-Apr-2005 |
Stefan Farfeleder <stefanf@FreeBSD.org> |
Remove unused variables.
|
Revision tags: vendor/bind9/9.3.1, vendor/nve/1.0.0301, vendor/bsnmp/1.8, vendor/openssl/0.9.7e, vendor/heimdal/0.6.3, vendor/NetBSD/lukemftp/20050219, vendor/tnftp/20050219, vendor/sendmail/8.13.3, vendor/netcat/20050204, vendor/openpam/FETERITA, release/4.11.0_cvs, release/4.11.0, vendor/file/4.12, vendor/ath/0.9.14.9, vendor/tzdata/tzdata2004g, vendor/acpica/20041119, release/5.3.0_cvs, release/5.3.0, vendor/openssh/3.9p1, vendor/libreadline/5.0p1-p5, vendor/libreadline/5.0, vendor/tzdata/tzdata2004e, vendor/gcc/3.4.2-20041014, vendor/ngatm/1.1.1, vendor/libbegemot/1.1.1, vendor/bind9/9.3.0, vendor/bind9/9.3.0rc4, vendor/pf/3.5.001, vendor/NetBSD/lukemftpd/20040809, vendor/isc-dhcp/3.0.1, vendor/openssl/0.9.7-dev, vendor/pf-sys/3.5.004, vendor/pf-sys/3.5.003, vendor/misc-GNU/sort/20040812, vendor/gcc/3.4.2-20040728, vendor/ngatm/1.1 |
|
#
30fd73fb |
| 09-Aug-2004 |
Diomidis Spinellis <dds@FreeBSD.org> |
Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived software (original contributor).
Reviewed by: imp
|
Revision tags: vendor/file/4.10, vendor/bsnmp/1.7, vendor/sendmail/8.13.1, vendor/ntp/4.2.0, vendor/pf-sys/3.5.002 |
|
#
81a8648a |
| 14-Jul-2004 |
Tim J. Robbins <tjr@FreeBSD.org> |
Make the 'y' (translate) command aware of multibyte characters.
|
#
b4828720 |
| 13-Jul-2004 |
Tim J. Robbins <tjr@FreeBSD.org> |
Overhaul lputs() to deal with multibyte characters, characters that take up more than one column position, and null bytes.
|
Revision tags: vendor/tcsh/6.13, vendor/ngatm/1.0, vendor/amd/6.0.10p1, vendor/misc-GNU/grep/2.5.1, vendor/libregex/from-grep-2.5.1, vendor/misc-GNU/sort/5.2.1, vendor/acpica/20040527, vendor/zlib/1.2.1, vendor/isc-dhcp/3.0.1rc14, vendor/gdb/marcel_contrib, vendor/ipfilter/3.4.35, vendor/ipfilter-sys/3-4-35, vendor/tzcode/tzcode2004a, vendor/pf-sys/3.5.001, vendor/pf/3.5, vendor/pf-sys/3.5, vendor/altq/20040607, vendor/misc-GNU/cvs/1.11.17, release/4.10.0_cvs, release/4.10.0, vendor/acpica/20040514, vendor/libuwx/BETA7, vendor/pf-sys/3.4.003, vendor/NetBSD/lukemftp/20040426, vendor/tnftp/20040426, vendor/openssh/3.8.1p1, vendor/less/v381, vendor/misc-GNU/cvs/1.11.15, vendor/bsnmp/1.6, vendor/acpica/20040402, vendor/pf-sys/3.4.002, vendor/openssl/0.9.7d-p1, vendor/heimdal/0.6.1, vendor/com_err/0.6.1, vendor/tcpdump/3.8.3, vendor/libpcap/0.8.3, vendor/pf-sys/3.4.001, vendor/acpica/20040311, vendor/openssl/0.9.7d, vendor/openssl/0.9.7c-patch1, vendor/misc-GNU/grep/2.4.2, vendor/acpica/20040220, vendor/pf/3.4, vendor/openssh/3.8p1, vendor/pf-sys/3.4, vendor/SGI/vjs_20020502, vendor/libregex/from-grep-2.4.2, release/5.2.1_cvs, release/5.2.1, vendor/sendmail/8.12.11, vendor/libreadline/4.3p1-p5, vendor/openpam/EELGRASS, vendor/one-true-awk/20040207, vendor/one-true-awk/20030731, vendor/bsnmp/1.5a, vendor/gdtoa/20040118, release/5.2.0_cvs, release/5.2.0, vendor/alsa/1.9, vendor/openssh/3.7.1p2, vendor/acpica/20031203, vendor/ath/0.9.6.3, vendor/ath/0.9.6.1, vendor/bind/8.3.7, vendor/bsnmp/1.4, vendor/ngatm/0.91, vendor/gcc/3.3.3-20031106 |
|
#
f54cda14 |
| 04-Nov-2003 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Reimplement in-place editing in a slightly less disgusting manner. Also, make an effort to preserve the ownership and mode of the file we are editing.
Sponsored by: Registrar AS
|
#
9cde9a2e |
| 04-Nov-2003 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Whitespace cleanup
|
#
e6478125 |
| 04-Nov-2003 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
ANSIfy
|
Revision tags: vendor/NetBSD/lukemftp/20031103, vendor/tnftp/20031103 |
|
#
ce20a8e9 |
| 02-Nov-2003 |
Tim J. Robbins <tjr@FreeBSD.org> |
Change the buffer length test in NEEDSP() so that it does not subtract one unsigned number from another potentially smaller one, leading to wraparound (and heap corruption, eventually).
PR: 58813 M
Change the buffer length test in NEEDSP() so that it does not subtract one unsigned number from another potentially smaller one, leading to wraparound (and heap corruption, eventually).
PR: 58813 MFC after: 2 weeks
show more ...
|
Revision tags: vendor/ath/0.9.5.17, vendor/ngatm/0.9, vendor/libuwx/BETA6, release/4.9.0_cvs, release/4.9.0, vendor/tzdata/tzdata2003d, vendor/heimdal/cvs-20030922, vendor/heimdal/0.6, vendor/libuwx/BETA5, vendor/openssl/0.9.7c, vendor/sendmail/8.12.10, vendor/sendmail/200309_parseaddr_patch, vendor/openssh/200309-xrealloc-patch, vendor/openssh/200309-buffer-patch, vendor/amd/6.0.9, vendor/isc-dhcp/3.0.1rc12, vendor/libreadline/4.3, vendor/misc-GNU/sort/2.1, vendor/gcc/3.3.1, vendor/acpica/20030619, vendor/ath/0.9.5.2, vendor/one-true-awk/20030729, vendor/openpam/DOGWOOD, vendor/gcc/3.3.1-20030711, vendor/NetBSD/lukemftp/20030630, vendor/tnftp/20030630, vendor/ath/0.9.4.0, vendor/misc-GNU/texinfo/4.6, vendor/bind/8.3.6, vendor/NetBSD/lukemftp/20030615, vendor/tnftp/20030615 |
|
#
c2b9b6eb |
| 05-Jun-2003 |
Tony Finch <fanf@FreeBSD.org> |
Do not dribble zero bytes into the output, by replacing an obfuscated if whose true and false clauses were equivalent with a check that we are not about to stumble off the end of the line.
Reported
Do not dribble zero bytes into the output, by replacing an obfuscated if 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
show more ...
|
Revision tags: release/5.1.0_cvs, release/5.1.0 |
|
#
2f17b7e2 |
| 04-Jun-2003 |
Tony Finch <fanf@FreeBSD.org> |
Fix substitution when the regex matches the zero-length string. 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 f
Fix substitution when the regex matches the zero-length string. 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
show more ...
|
Revision tags: vendor/openpam/DIGITALIS, vendor/acpica/20030228b, vendor/acpica/20030228a, vendor/libuwx/BETA4, vendor/openpam/DIANTHUS, vendor/misc-GNU/texinfo/4.5, vendor/groff/1.19, vendor/acpica/20030228, vendor/tzdata/tzdata2003a, vendor/openssh/3.6.1p1, vendor/alsa/1.8, vendor/alsa/1.51, vendor/alsa/1.39, release/4.8.0_cvs, release/4.8.0, vendor/sendmail/8.12.9, vendor/gdtoa/20030324, vendor/openssl/secfix-20030317, vendor/openssl/secfix-20030319, vendor/gdtoa/20030318, vendor/one-true-awk/20030314, vendor/gdtoa/20030305, vendor/sendmail/8.12.8, vendor/tcpdump/3.7.2, vendor/file/3.41, vendor/ext2fs/2.4.3-rh7.1, vendor/openssl/0.9.7a, vendor/file/3.40, vendor/ipfilter/3.4.31, vendor/ipfilter-sys/3-4-31, vendor/sendmail/8.12.7-protofix, vendor/gcc/3.2.2-20030205, vendor/sendmail/8.12.7, vendor/NetBSD/lukemftpd/20030122, vendor/openssl/0.9.7-stable-1, vendor/openssl/0.9.7, vendor/bind/8.3.4, vendor/misc-GNU/cvs/1.11.5, vendor/heimdal/0.5.1-patch, release/5.0.0_cvs, release/5.0.0, vendor/isc-dhcp/3.0.1rc11, vendor/isc-dhcp/3.0.1rc10, vendor/openpam/DAFFODIL, vendor/NetBSD/lukemftpd/20030105, vendor/one-true-awk/20021213, vendor/openpam/CYCLAMEN, vendor/one-true-awk/20021129, vendor/gcc/3.2.1, vendor/binutils/2.13.2_20021127, vendor/misc-GNU/cvs/1.11.2.1-20021201, vendor/acpica/20021118, vendor/heimdal/0.5.1, vendor/bind/8.3.3.patched, vendor/NetBSD/lukemftpd/1.2-beta2, vendor/ntp/4.1.1b, vendor/ntp/4.1.1a, vendor/openssh/3.5p1, vendor/tzdata/tzdata2002d, vendor/gdb/5.2.1, vendor/ncurses/5.2-20020907-ac-fix, vendor/binutils/2.13.20021011, vendor/groff/1.18.1, vendor/gcc/3.2-20021009, release/4.7.0_cvs, vendor/acpica/20021002, vendor/expat/1.95.5, vendor/heimdal/cvs-20020930, vendor/isc-dhcp/3.0.1rc9 |
|
#
b81df081 |
| 20-Sep-2002 |
Eric Melville <eric@FreeBSD.org> |
Initialize a variable in order to fix when faced with picky compilers.
Sponsored by: Apple
|
Revision tags: vendor/gcc/3.2-20020916, vendor/heimdal/cvs-20020916, vendor/file/3.39, vendor/misc-GNU/cvs/1.11.2, vendor/gcc/3.2-20020901, vendor/binutils/2.12.20020720, vendor/heimdal/cvs-20020829, vendor/acpica/20020815, vendor/sendmail/8.12.6, vendor/ipfilter/3.4.29, vendor/ipfilter-sys/3-4-29, release/4.6.2_cvs, release/4.6.2 |
|
#
13ee49d3 |
| 11-Aug-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Correct boundary condition error in `D' and `P' commands when the last line of the pattern space is empty. Don't emit spurious newline when EOF is reached with the `N' command.
Pointed out by: Oleg
Correct boundary condition error in `D' and `P' commands when the last 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
show more ...
|
Revision tags: vendor/openssl/0.9.6g, vendor/openssl/0.9.6f, vendor/openssl/0.9.6e-asn1-patch, vendor/acpica/20020725, vendor/openssl/0.9.6e, vendor/openssl/0.9.6d, vendor/traceroute/1.4.a12, vendor/tcsh/6.12, vendor/misc-GNU/texinfo/4.2, vendor/smbfs/1.4.5, release/4.6.1, vendor/NetBSD/xlint/2002-07-19 |
|
#
8bd89d7e |
| 19-Jul-2002 |
Mark Murray <markm@FreeBSD.org> |
s/inline/__inline/
|
Revision tags: vendor/acpica/20020611 |
|
#
dfb072f4 |
| 08-Jul-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Make cspace()'s second argument const. Make `escapes' in lputs() const.
|
Revision tags: vendor/binutils/2.12.20020622, vendor/NetBSD/d20020701 |
|
#
8523e9a6 |
| 03-Jul-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Avoid checking whether each line is the last line of the file when we don't need to know. Instead, check when we are trying to match a "$" address. This does not change the way sed processes regular
Avoid checking whether each line is the last line of the file when we don't 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
show more ...
|
#
5a323225 |
| 03-Jul-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Don't let the pattern space become null if the `x' command is used when the hold space is null; some functions assume it's never null.
MFC after: 3 days
|
Revision tags: release/4.6.0, vendor/bind/8.3.3, vendor/openpam/CITRONELLA, vendor/acpica/20020404, vendor/openssh/3.4p1, vendor/gdb/anoncvs_gdb_5_2_branch_20020627, vendor/openssh/3.3p1, vendor/sendmail/8.12.5 |
|
#
d1a1392d |
| 24-Jun-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Fix off by one in `y' (transliterate) command which caused the last character of the pattern space not to be examined.
Noticed by: Motoyuki Konno <motoyuki@bsdclub.org>
|
Revision tags: vendor/openssh/3.3 |
|
#
5953156d |
| 22-Jun-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Now that the pattern space contains no trailing newline, modify the `l' command's output so it's the same as what SUSv3 specifies.
|
#
ed92199d |
| 22-Jun-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Don't store newlines at the end of each line in the hold/pattern spaces, instead add the newline when the pattern space is printed. Make the `G' and `H' commands add a newline to the space before the
Don't store newlines at the end of each line in the hold/pattern spaces, 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
show more ...
|
Revision tags: vendor/NetBSD/head_20020621, vendor/libpcap/0.7.1, vendor/tcpdump/3.7.1, vendor/ncurses/5.2-20020615, vendor/NetBSD/lukemftp/1.6.BETA2, vendor/tnftp/1.6.BETA2, vendor/sendmail/8.12.4 |
|
#
e307a7a1 |
| 10-Jun-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Don't write escape newlines with `l' command (SUSv3)
|
#
03fef72f |
| 10-Jun-2002 |
Tim J. Robbins <tjr@FreeBSD.org> |
Correctly handle global substitutions where the pattern is only "$", the EOL anchor, when the last input line does not end in a newline character. Picked up by the GNU sed test suite.
|