mirror of
git://git.sv.gnu.org/sed
synced 2026-11-21 01:43:22 +03:00
53d12197e2b0bb35410a38ea7664f1c7bb43e9e6
With --posix, normalize_text tracks bracket-expression state to avoid converting \X escapes inside bracket expressions. It uses p[-1] and p[-2] to detect the closing sequence of POSIX classes like [:alpha:]. However, normalize_text operates in-place with separate read (p) and write (q) pointers, and when an earlier \n was collapsed from two bytes to one, q falls behind p, so p[-1] and p[-2] read positions already overwritten by q. E.g., with '^A\n[[:alpha:]]\n*', the first \n shrinks, putting q one byte behind p. When processing the closing ']' in '[:alpha:]', p[-2] reads ':' (written by q) rather than the original 'a', making the "p[-2] != bracket_state" check fail. Then, the second \n is never converted to a newline. * sed/compile.c (normalize_text): Use q[-1] and q[-2] for bracket state tracking, not p[-1] and p[-2]. * NEWS: Mention this bug fix. * testsuite/posix-bracket-esc.sh: New test. * testsuite/local.mk (T): Add it. Reported by Wolfgang Jeltsch in https://debbugs.gnu.org/77786
This is the GNU implementation of sed, the Unix stream editor. GNU Sed website: https://www.gnu.org/software/sed/ See the NEWS file for a brief summary and the ChangeLog for more detailed descriptions of changes. If you obtained this file as part of a "git clone", then see the README-hacking file. If this file came to you as part of a tar archive, then see the file INSTALL for compilation and installation instructions. See the file BUGS for instructions about reporting bugs. See the files AUTHORS and THANKS for a list of authors and other contributors. See the file COPYING for copying conditions. After installation run 'sed --help' or 'man sed' for short usage information, and 'info sed' for the complete manual. The manual is also available on sed's website.
Description
SED (stream editor) - неинтерактивный текстовый редактор командной строки
https://www.gnu.org/software/sed/
3 MiB
0 Stars
1 Watchers
0 Forks
Languages
Shell
43%
C
26.4%
Perl
16.5%
sed
7.3%
Makefile
5.2%
Other
1.6%