1
0
mirror of git://git.sv.gnu.org/sed synced 2025-04-18 02:37:37 +03:00

maint: quote 'like this' not `like this'

This commit is contained in:
Paul Eggert 2023-01-30 09:45:13 -08:00
parent fa9e4e4fc0
commit 8c802c5078
23 changed files with 314 additions and 308 deletions

76
BUGS
View File

@ -5,7 +5,7 @@ and the list of oft-reported non-bugs (below).
Bugs and comments may be sent to bonzini@gnu.org; please
include in the Subject: header the first line of the output of
``sed --version''.
"sed --version".
Please do not send a bug report like this:
@ -20,19 +20,19 @@ case.
A stand-alone test case includes all the data necessary to perform the
test, and the specific invocation of sed that causes the problem. The
smaller a stand-alone test case is, the better. A test case should
not involve something as far removed from sed as ``try to configure
frobme-1.3.4''. Yes, that is in principle enough information to look
not involve something as far removed from sed as "try to configure
frobme-1.3.4". Yes, that is in principle enough information to look
for the bug, but that is not a very practical prospect.
* NON-BUGS
`N' command on the last line
'N' command on the last line
Most versions of sed exit without printing anything when the `N'
Most versions of sed exit without printing anything when the 'N'
command is issued on the last line of a file. GNU sed instead
prints pattern space before exiting unless of course the `-n'
prints pattern space before exiting unless of course the '-n'
command switch has been specified. More information on the reason
behind this choice can be found in the Info manual.
@ -41,71 +41,71 @@ regex syntax clashes (problems with backslashes)
sed uses the Posix basic regular expression syntax. According to
the standard, the meaning of some escape sequences is undefined in
this syntax; notable in the case of GNU sed are `\|', `\+', `\?',
`\`', `\'', `\<', `\>', `\b', `\B', `\w', and `\W'.
this syntax; notable in the case of GNU sed are '\|', '\+', '\?',
'\'', '\'', '\<', '\>', '\b', '\B', '\w', and '\W'.
As in all GNU programs that use Posix basic regular expressions, sed
interprets these escape sequences as meta-characters. So, `x\+'
matches one or more occurrences of `x'. `abc\|def' matches either
`abc' or `def'.
interprets these escape sequences as meta-characters. So, 'x\+'
matches one or more occurrences of 'x'. 'abc\|def' matches either
'abc' or 'def'.
This syntax may cause problems when running scripts written for other
seds. Some sed programs have been written with the assumption that
`\|' and `\+' match the literal characters `|' and `+'. Such scripts
'\|' and '\+' match the literal characters '|' and '+'. Such scripts
must be modified by removing the spurious backslashes if they are to
be used with recent versions of sed (not only GNU sed).
On the other hand, some scripts use `s|abc\|def||g' to remove occurrences
of _either_ `abc' or `def'. While this worked until sed 4.0.x, newer
versions interpret this as removing the string `abc|def'. This is
On the other hand, some scripts use 's|abc\|def||g' to remove occurrences
of _either_ 'abc' or 'def'. While this worked until sed 4.0.x, newer
versions interpret this as removing the string 'abc|def'. This is
again undefined behavior according to POSIX, but this interpretation
is arguably more robust: the older one, for example, required that
the regex matcher parsed `\/' as `/' in the common case of escaping
the regex matcher parsed '\/' as '/' in the common case of escaping
a slash, which is again undefined behavior; the new behavior avoids
this, and this is good because the regex matcher is only partially
under our control.
In addition, GNU sed supports several escape characters (some of
which are multi-character) to insert non-printable characters
in scripts (`\a', `\c', `\d', `\o', `\r', `\t', `\v', `\x'). These
in scripts ('\a', '\c', '\d', '\o', '\r', '\t', '\v', '\x'). These
can cause similar problems with scripts written for other seds.
-i clobbers read-only files
In short, `sed d -i' will let one delete the contents of
a read-only file, and in general the `-i' option will let
In short, 'sed d -i' will let one delete the contents of
a read-only file, and in general the '-i' option will let
one clobber protected files. This is not a bug, but rather a
consequence of how the Unix file system works.
The permissions on a file say what can happen to the data
in that file, while the permissions on a directory say what can
happen to the list of files in that directory. `sed -i'
happen to the list of files in that directory. 'sed -i'
will not ever open for writing a file that is already on disk,
rather, it will work on a temporary file that is finally renamed
to the original name: if you rename or delete files, you're actually
modifying the contents of the directory, so the operation depends on
the permissions of the directory, not of the file). For this same
reason, sed will not let one use `-i' on a writeable file in a
reason, sed will not let one use '-i' on a writeable file in a
read-only directory, and will break hard or symbolic links when
`-i' is used on such a file.
'-i' is used on such a file.
`0a' does not work (gives an error)
'0a' does not work (gives an error)
There is no line 0. 0 is a special address that is only used to treat
addresses like `0,/RE/' as active when the script starts: if you
write `1,/abc/d' and the first line includes the word `abc', then
addresses like '0,/RE/' as active when the script starts: if you
write '1,/abc/d' and the first line includes the word 'abc', then
that match would be ignored because address ranges must span at least
two lines (barring the end of the file); but what you probably wanted is
to delete every line up to the first one including `abc', and this
is obtained with `0,/abc/d'.
to delete every line up to the first one including 'abc', and this
is obtained with '0,/abc/d'.
`[a-z]' is case insensitive
`s/.*//' does not clear pattern space
'[a-z]' is case insensitive
's/.*//' does not clear pattern space
You are encountering problems with locales. POSIX mandates that `[a-z]'
You are encountering problems with locales. POSIX mandates that '[a-z]'
uses the current locale's collation order -- in C parlance, that means
strcoll(3) instead of strcmp(3). Some locales have a case insensitive
strcoll, others don't.
@ -113,20 +113,20 @@ regex syntax clashes (problems with backslashes)
Another problem is that [a-z] tries to use collation symbols. This
only happens if you are on the GNU system, using GNU libc's regular
expression matcher instead of compiling the one supplied with GNU sed.
In a Danish locale, for example, the regular expression `^[a-z]$'
matches the string `aa', because `aa' is a single collating symbol that
comes after `a' and before `b'; `ll' behaves similarly in Spanish
locales, or `ij' in Dutch locales.
In a Danish locale, for example, the regular expression '^[a-z]$'
matches the string 'aa', because 'aa' is a single collating symbol that
comes after 'a' and before 'b'; 'll' behaves similarly in Spanish
locales, or 'ij' in Dutch locales.
Another common localization-related problem happens if your input stream
includes invalid multibyte sequences. POSIX mandates that such
sequences are _not_ matched by `.', so that `s/.*//' will not clear
sequences are _not_ matched by '.', so that 's/.*//' will not clear
pattern space as you would expect. In fact, there is no way to clear
sed's buffers in the middle of the script in most multibyte locales
(including UTF-8 locales). For this reason, GNU sed provides a `z'
command (for `zap') as an extension.
(including UTF-8 locales). For this reason, GNU sed provides a 'z'
command (for 'zap') as an extension.
However, to work around both of these problems, which may cause bugs
in shell scripts, you can set the LC_ALL environment variable to `C',
in shell scripts, you can set the LC_ALL environment variable to 'C',
or set the locale on a more fine-grained basis with the other LC_*
environment variables.

View File

@ -347,7 +347,7 @@
2010-08-17 Paolo Bonzini <bonzini@gnu.org>
Fix imprecision in the documentation of `D'.
Fix imprecision in the documentation of 'D'.
* doc/sed-in.texi (D command): Fix documentation of behavior for
pattern space ending with \n and with no other newline.
Reported by Randall Cotton.
@ -550,7 +550,7 @@
* sed/sed.c (contact): New.
(usage): From here.
(main): Use it for `sed --version' too.
(main): Use it for 'sed --version' too.
* configure.ac: Point to GNU project mailing lists.
* sed/sed.c (contact): Use PACKAGE_BUGREPORT.
@ -577,8 +577,8 @@
2009-01-28 Paolo Bonzini <bonzini@gnu.org>
* sed/sed.c (usage): Only print the bug report address for `sed --help'.
(main): Print it for `sed --version' too.
* sed/sed.c (usage): Only print the bug report address for 'sed --help'.
(main): Print it for 'sed --version' too.
* testsuite/version.gin: Adapt.
* testsuite/Makefile.tests: Refine help message test.
@ -609,8 +609,8 @@
Let --posix turn off more GNU extensions.
* sed/compile.c (mark_subst_opts): Turn off subst options i, I,
s, S, x, X, m, and M in --posix mode.
(compile_address): Disallow address modifiers, `FIRST~STEP',
`ADDR1,+N', and `ADDR1,~N' in --posix mode.
(compile_address): Disallow address modifiers, 'FIRST~STEP',
'ADDR1,+N', and 'ADDR1,~N' in --posix mode.
(compile_program): In --posix mode, do not accept e or z commands;
do not accept text between an a, c, or i command and the following
backslash; do not accept an argument to the l command.
@ -658,10 +658,10 @@
2008-09-29 Paolo Bonzini <bonzini@gnu.org>
* BUGS: Document s/.*.// behavior with invalid multibyte sequences.
* NEWS: Document `z' extension.
* NEWS: Document 'z' extension.
* doc/sed-in.texi: Document both things.
* sed/compile.c (compile_program): Recognize `z'.
* sed/execute.c (execute_program): Execute `z'.
* sed/compile.c (compile_program): Recognize 'z'.
* sed/execute.c (execute_program): Execute 'z'.
* testsuite/Makefile.am: Add badenc test.
* testsuite/Makefile.tests: Add badenc test.
* testsuite/badenc.good: New.
@ -837,7 +837,7 @@
2006-08-21 Paolo Bonzini <bonzini@gnu.org>
* sed/regexp.c: Accept NUL bytes for `.'. Accept 'a\(b' in
* sed/regexp.c: Accept NUL bytes for '.'. Accept 'a\(b' in
POSIXLY_CORRECT/POSIXLY_BASIC posixicity.
2006-08-03 Paolo Bonzini <bonzini@gnu.org>
@ -1083,7 +1083,7 @@
* sed/execute.c (match_address_p): Rewritten. Handle
ADDR_IS_NUM here.
(match_an_address_p): Suit to new match_address_p.
(execute_program): Adjust to use range_state in `c'.
(execute_program): Adjust to use range_state in 'c'.
Handle addr_bang here.
(reset_addresses): Use range_state.
@ -1183,30 +1183,30 @@
newline, if necessary.
(flush_output): New function for a common pattern.
(output_line): Use struct output, set its flag accordingly.
(dump_append_queue): Use `ck_fwrite' instead of output_line.
(dump_append_queue): Use 'ck_fwrite' instead of output_line.
(do_list): Flush the output stream at the end.
(closedown): The code ``if(separate_files) rewind_read_files();''
(closedown): The code "if(separate_files) rewind_read_files();"
(read_pattern_space): ... has been moved here.
(process_files): Don't do the default `p' at the end, ...
(process_files): Don't do the default 'p' at the end, ...
(execute_program): ... as this function is now responsible for it;
add the code to the end of the function and to the command `q';
the commands `d', `D' and `Q' thus no longer have to forge an empty
add the code to the end of the function and to the command 'q';
the commands 'd', 'D' and 'Q' thus no longer have to forge an empty
line.
(execute_program): Commands `c' and `i' no longer call the
(execute_program): Commands 'c' and 'i' no longer call the
function output_line with chomped==FALSE; instead, they chomp
the text and call the function with chomped==TRUE.
(execute_program): Command `e' no longer uses output_line; it
calls ck_fwrite directly. Commands `e', `L' and `=' flush
(execute_program): Command 'e' no longer uses output_line; it
calls ck_fwrite directly. Commands 'e', 'L' and '=' flush
the output stream at the end.
* sed/compile.c (special_files): Use `struct output' instead of the
* sed/compile.c (special_files): Use 'struct output' instead of the
file name.
(get_openfile): ... special files are no longer copied to file_read
or file_write.
(fp_list): Move to sed.h (users adjusted) and rename as...
* sed/sed.h (struct output): ...this. New flag missing_newline
associated to the output stream.
(struct sed_cmd, struct subst): Use `struct output *' instead of mere
`FILE *'; adjust compile.c and execute.c.
(struct sed_cmd, struct subst): Use 'struct output *' instead of mere
'FILE *'; adjust compile.c and execute.c.
* testsuite/noeolw.sed, testsuite/noeolw.good, testsuite/noeolw.1good,
testsuite/noeolw.2good: New tests
@ -1269,7 +1269,7 @@
2003-03-13 Paolo Bonzini <bonzini@gnu.org>
* sed/compile.c (compile_program): Understand parameter
of `v'.
of 'v'.
* sed/sed.c (usage): Split help message into multiple
strings
@ -1349,7 +1349,7 @@
2002-12-16 Paolo Bonzini <bonzini@gnu.org>
* sed/compile.c: Improvements to some error messages;
`a', `i', `l', `L', `r' accept two addresses except in
'a', 'i', 'l', 'L', 'r' accept two addresses except in
POSIXLY_CORRECT mode.
2002-12-14 Paolo Bonzini <bonzini@gnu.org>
@ -1450,16 +1450,16 @@
* src/compile.c: Likewise
* src/execute.c: Likewise
* src/compile.c (compile_command): Parse `l' like
`q' and `Q'; default for int_arg is -1
* src/compile.c (compile_command): Parse 'l' like
'q' and 'Q'; default for int_arg is -1
* src/execute.c (do_list): New argument, used instead
of lcmd_out_line_len
(execute_program): Interpret int_arg for the `l' command;
return 0 for `q' and `Q' if int_arg is -1
(execute_program): Interpret int_arg for the 'l' command;
return 0 for 'q' and 'Q' if int_arg is -1
* src/fmt.c: New file, looted from GNU textutils
* src/compile.c: Parse `L'
* src/execute.c: Execute `L'
* src/compile.c: Parse 'L'
* src/execute.c: Execute 'L'
2002-04-23 Paolo Bonzini <bonzini@gnu.org>
@ -1469,7 +1469,7 @@
* src/execute.c (reset_addresses): New function to make range
addresses work separately on each file when using in-place
editing
* src/execute.c (execute_program): The `n' and `N' use test_eof
* src/execute.c (execute_program): The 'n' and 'N' use test_eof
so that the script restarts at end of file, not at end of input
* src/execute.c (test_dollar_EOF): Make $ work separately
on each file when using -s; renamed to test_eof
@ -1520,7 +1520,7 @@
* testsuite/uniq.sed, testsuite/uniq.inp, testsuite/uniq.good:
added to test P and D commands.
* testsuite/fasts.sed, testsuite/fasts.inp, testsuite/fasts.good:
added to test the new optimization done on the `s' command.
added to test the new optimization done on the 's' command.
2001-12-17 Paolo Bonzini <bonzini@gnu.org>
@ -1540,15 +1540,15 @@
2001-11-09 Paolo Bonzini <bonzini@gnu.org>
* sed/compile.c (mark_subst_opts): Parse option `e',
preserve two occurrences of the `e' and `p' options.
* sed/compile.c (mark_subst_opts): Parse option 'e',
preserve two occurrences of the 'e' and 'p' options.
* sed/execute.c (do_subst) [HAVE_POPEN]: Interpret option
`e' (evaluate, like Perl's but uses Bourne shell).
* sed/sed.h (struct subst): Add an `eval' flag.
'e' (evaluate, like Perl's but uses Bourne shell).
* sed/sed.h (struct subst): Add an 'eval' flag.
* sed/compile.c (compile_program): Compile command `e'
like `c'.
* sed/execute.c (execute_program): Execute command `e'.
* sed/compile.c (compile_program): Compile command 'e'
like 'c'.
* sed/execute.c (execute_program): Execute command 'e'.
2001-09-25 Paolo Bonzini <bonzini@gnu.org>
@ -1566,9 +1566,9 @@
2001-09-05 Paolo Bonzini <bonzini@gnu.org>
* sed/execute.c (do_subst): `baaac', if passed through
s/a*/x/g, gave `xbxxcx' rather than `xbxcx' (because an
empty string matched before the `c'. Fixed.
* sed/execute.c (do_subst): 'baaac', if passed through
s/a*/x/g, gave 'xbxxcx' rather than 'xbxcx' (because an
empty string matched before the 'c'. Fixed.
* sed/execute.c: Removed mmap support, I/O is done using
getline (slower but more bug-proof).
@ -1620,7 +1620,7 @@
2001-01-03 Paolo Bonzini <bonzini@gnu.org>
* sed/compile.c(snarf_char_class) [REG_PERL]: Don't parse
`\n' specially
'\n' specially
* sed/compile.c(match_slash) [REG_PERL]: Ditto
* sed/compile.c(read_text) [REG_PERL]: Support [xX] modifiers
@ -1629,12 +1629,12 @@
2001-01-04 Paolo Bonzini <bonzini@gnu.org>
* testsuite/Makefile.am: Use automake's implementation
of `make check'. Removed the test targets
of 'make check'. Removed the test targets
* testsuite/Makefile.tests: Moved the test targets here
(new file).
* testsuite/runtest: New file
* testsuite/Makefile.tests: `khadafy' test uses EREs.
* testsuite/Makefile.tests: 'khadafy' test uses EREs.
* testsuite/spencer.inp: Removed the ^* test
@ -1642,16 +1642,16 @@
2001-01-07 Paolo Bonzini <bonzini@gnu.org>
* sed/compile.c (compile_program): Added `T' (branch if failed)
* sed/compile.c (compile_program): Added 'T' (branch if failed)
* sed/execute.c (shrink_program, execute_program): Ditto
2001-02-08 Paolo Bonzini <bonzini@gnu.org>
* sed/compile.c (compile_program): Added `Q' (quit without output)
* sed/compile.c (compile_program): Added 'Q' (quit without output)
* sed/execute.c (execute_program): Ditto
* sed/compile.c (compile_program): Fill in exit_status for `q' and `Q'
* sed/execute.c (execute_program): Return -1 for `go on', 0..255
* sed/compile.c (compile_program): Fill in exit_status for 'q' and 'Q'
* sed/execute.c (execute_program): Return -1 for 'go on', 0..255
to set the exit status
* sed/execute.c (process_files): Interpret new convention for
execute_program, return sed's exit code
@ -1677,7 +1677,7 @@
2000-12-08 Paolo Bonzini <bonzini@gnu.org>
* basicdefs.h: Moved here from the `sed' subdirectory.
* basicdefs.h: Moved here from the 'sed' subdirectory.
* configure.in: Removed crap to pick a regex engine.
Added snprintf to the AC_REPLACE_FUNCS call.
@ -1687,9 +1687,9 @@
* sed/regex.c(compile_regex): Use regncomp
* sed/regex.c(match_regex): Use regexec2
* sed/compile.c(compile_program): Implemented the `v' command.
* sed/compile.c(compile_program): Implemented the 'v' command.
* sed/sed.c(main): Implemented the `r' and `R' options
* sed/sed.c(main): Implemented the 'r' and 'R' options
* sed/sed.h: Replaced use_extended_syntax_t with
extended_regexp_flags to support Perl regular expressions.
@ -1820,7 +1820,7 @@ Mon Nov 23 11:03:40 PST 1998 Ken Pizzini <ken@gnu.org>
Sun Nov 1 00:09:07 PST 1998 Ken Pizzini <ken@gnu.org>
* sed/execute.c(do_list): make a `lcmd_out_line_len'
* sed/execute.c(do_list): make a 'lcmd_out_line_len'
(--line-length) of zero mean "infinite length",
i.e., "never wrap".
@ -1837,39 +1837,39 @@ Sat Oct 31 23:06:50 PST 1998 Ken Pizzini <ken@gnu.org>
Sat Oct 31 22:18:59 PST 1998 Ken Pizzini <ken@gnu.org>
* sed/sed.c, sed/sed.h, sed/execute.c: added new
`lcmd_out_line_len' variable. (Idea suggested by
'lcmd_out_line_len' variable. (Idea suggested by
Carlos J. G. Duarte <l38076@alfa.ist.utl.pt>.)
Also added ATOI macro (which uses strtoul() if available,
with fall-back to atoi()).
* sed/sed.c(main): attempt to use COLS environment variable
to set a reasonable `lcmd_out_line_len'; added -l/--line-length
command-line options to set the new `lcmd_out_line_len' flag.
to set a reasonable 'lcmd_out_line_len'; added -l/--line-length
command-line options to set the new 'lcmd_out_line_len' flag.
* sed/sed.c(usage): documented new -l/--line-length options.
* sed/execute.c(do_list): use `lcmd_out_line_len' variable
instead of `LCMD_OUT_LINE_LEN'.
* sed/execute.c(do_list): use 'lcmd_out_line_len' variable
instead of 'LCMD_OUT_LINE_LEN'.
* sed/execute.c: deleted now obsolete LCMD_OUT_LINE_LEN define.
* configure.in: added strtoul to the AC_CHECK_FUNCS call.
Sat Oct 31 21:37:17 PST 1998 Ken Pizzini <ken@gnu.org>
* sed/sed.c, sed/sed.h, sed/execute.c: added new `force_unbuffered'
* sed/sed.c, sed/sed.h, sed/execute.c: added new 'force_unbuffered'
flag. (Idea suggested by Frank Strauss <strauss@escape.de>.)
* sed/sed.c(main): added -u/--unbuffered command-line options
to set the new `force_unbuffered' flag.
to set the new 'force_unbuffered' flag.
* sed/sed.c(usage): documented new -u/--unbuffered options.
* sed/execute.c: changed the name of the `is_tty' flag in struct
input to a more generic `no_buffering'; also removed HAVE_ISATTY
* sed/execute.c: changed the name of the 'is_tty' flag in struct
input to a more generic 'no_buffering'; also removed HAVE_ISATTY
conditional on this member.
* sed/execute.c(slow_getline): removed HAVE_ISATTY conditonal
compilation of this function.
* sed/execute.c(output_line): if force_unbuffered is set,
then force a fflush() even if writing to stdout.
* sed/execute.c(open_next_file): added handling of the
new `force_unbuffered' flag so that slow_getline()
new 'force_unbuffered' flag so that slow_getline()
will always be used for input.
* sed/execute.c(read_file_line): changed the (conditionally
compiled) test of `input->is_tty' to (unconditionally)
use the new spelling `input->no_buffering'.
compiled) test of 'input->is_tty' to (unconditionally)
use the new spelling 'input->no_buffering'.
Thu Oct 15 12:08:09 PDT 1998 Ken Pizzini <ken@gnu.org>
@ -1880,7 +1880,7 @@ Thu Oct 15 12:08:09 PDT 1998 Ken Pizzini <ken@gnu.org>
Sun Sep 27 01:42:42 PDT 1998 Ken Pizzini <ken@gnu.org>
* compile.c(compile_program): remove special-case code for matching
address range with a `0' beginning.
address range with a '0' beginning.
* compile.c(compile_address): change default addr_number to
be a pragmatically impossible countT value, instead of zero.
@ -2034,22 +2034,22 @@ Sat May 30 12:23:16 PDT 1998 Ken Pizzini <ken@gnu.org>
whether fclose(NULL) is properly supported on a given
platform.)
* sed/sed.h: Renamed `struct text_buf' member `text_len'
to `text_length'. Abstracted out `enum addr_types'
from `struct addr'; added new enum types num2,step,step_mod;
* sed/sed.h: Renamed 'struct text_buf' member 'text_len'
to 'text_length'. Abstracted out 'enum addr_types'
from 'struct addr'; added new enum types num2,step,step_mod;
renamed mod to num_mod. De-unionized the regex,number,
{modulo-offset/step} components of `struct addr', in
anticipation of new features. Changed type of `a2' member
of `struct sed_cmd': now a pointer to save space.
Abstracted out `struct replacement' from `struct subst'.
Cleaned up declaration of `x' union of `struct addr'.
{modulo-offset/step} components of 'struct addr', in
anticipation of new features. Changed type of 'a2' member
of 'struct sed_cmd': now a pointer to save space.
Abstracted out 'struct replacement' from 'struct subst'.
Cleaned up declaration of 'x' union of 'struct addr'.
Fixed prototype for compile_string(). Replaced prototype
for old close_all_files() with one for new finish_program().
* sed/sed.h, sed/compile.c, sed/execute.c: changed to
simplify the data structures used for branches and
command blocks: simplified `struct vector'; made
`struct label' local to compile.c; `struct sed_cmd'
command blocks: simplified 'struct vector'; made
'struct label' local to compile.c; 'struct sed_cmd'
was modified to support a simpler design for branches
and blocks.
@ -2105,10 +2105,10 @@ Sat May 30 12:23:16 PDT 1998 Ken Pizzini <ken@gnu.org>
use line_exchange() function instead of custom in-line code.
* sed/execute.c(process_files): added NOLEAKS code.
* sed/execute.c(execute_program): updated implementations
of the `{', `}', `:', `b', and `t' commands; modified
`c' command gratuituosly; fixed potential memory
overrun in `D' command. Simplified how nonstandard
`loop increments' work. Use line_exchange() instead of
of the '{', '}', ':', 'b', and 't' commands; modified
'c' command gratuituosly; fixed potential memory
overrun in 'D' command. Simplified how nonstandard
'loop increments' work. Use line_exchange() instead of
custom in-line code in 'x' case.
* sed/execute.c[EXPERIMENTAL_DASH_N_OPTIMIZATION conditional
code]: various modifications intended to keep this
@ -2131,13 +2131,13 @@ Sat May 30 12:23:16 PDT 1998 Ken Pizzini <ken@gnu.org>
memory.
* sed/compile.c: deleted obsolete new_vector() function;
abstracted new read_label() function; abstracted new
release_label() function; added new `blocks' module-static
release_label() function; added new 'blocks' module-static
variable.
* sed/compile.c(compile_program): updated implementations
of the `{', `}', `:', `b', and `t' commands; modified
of the '{', '}', ':', 'b', and 't' commands; modified
initialization from NULL vector.
* sed/compile.c(compile_regex): added mechanism to
release memory consumed by the cached `last' RE.
release memory consumed by the cached 'last' RE.
* sed/compile.c(setup_jump,setup_label): updated
name (from setup_jump to setup_label) and prototype;
changed body to reflect data structure changes.
@ -2325,10 +2325,10 @@ Sun Jul 5 15:23:47 PDT 1998 Ken Pizzini <ken@gnu.org>
Sun Jul 5 14:29:45 PDT 1998 Ken Pizzini <ken@gnu.org>
* sed/compile.c(mark_subst_opts), sed/execute.c(do_subst):
Define better semantics for interaction of the `g' flag
Define better semantics for interaction of the 'g' flag
with a numeric flag to the s/// command. It used to
be that the `g' command siezed control; now the first
(number-1) matches are skipped and then `g' gets control
be that the 'g' command siezed control; now the first
(number-1) matches are skipped and then 'g' gets control
after that. (It is not clear whether this is a feature
sneaking in during late beta, or a bug fix; the changes
involved were trivial, so I decided to treat it as a bug
@ -2522,11 +2522,11 @@ Tue Jun 2 08:41:05 PDT 1998 Ken Pizzini <ken@gnu.org>
the rumored systems which stupidly #define __STDC__ 0.
* testsuite/help.good, testsuite/Makefile.in: make
the ``help'' test insensitive to the spelling of
the executable's name. Also, enhanced `make clean'
the "help" test insensitive to the spelling of
the executable's name. Also, enhanced 'make clean'
target.
* doc/sed.texi, doc/sed.1: correct documentation of `q'
* doc/sed.texi, doc/sed.1: correct documentation of 'q'
command; fix typos.
* configure, testsuite/version.good: update to beta10.
@ -2599,7 +2599,7 @@ Sat May 23 20:04:31 HST 1998 Ken Pizzini <ken@gnu.org>
* sed/execute.c(read_file_line): EOF check was wrong --
it forgot to allow for the possibility that we were
appending to the end of the ``line'' (instead of merely
appending to the end of the "line" (instead of merely
reading a fresh line).
Sat May 23 18:07:18 HST 1998 Ken Pizzini <ken@gnu.org>
@ -2829,8 +2829,8 @@ Wed May 6 23:35:12 PDT 1998 Ken Pizzini <ken@gnu.org>
related to the substitution of regex for rx.
* lib/Makefile.am, sed/Makefile.am: since regex is not a
``compatability'' module, changed name of library to
``libsed.a''.
"compatability" module, changed name of library to
"libsed.a".
* lib/memchr.c, lib/memcpy.c, lib/memmove.c: add conditional
compilation code to leave zero-sized .o file if system
@ -2844,7 +2844,7 @@ Wed May 6 23:35:12 PDT 1998 Ken Pizzini <ken@gnu.org>
Wed May 6 18:40:47 PDT 1998 Ken Pizzini <ken@gnu.org>
* sed/execute.c: discovered awful bug in '}' handling:
it could read past the end of vec (because `n' was
it could read past the end of vec (because 'n' was
being decremented below zero)! Needed to "continue"
instead of "break".
@ -3225,7 +3225,7 @@ Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com)
Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com)
* rx.c (solve_destination): protect `solution' more carefully.
* rx.c (solve_destination): protect 'solution' more carefully.
This is a cleanup of a patch from Kevin Buettner
(kev@cujo.geg.mot.com).
@ -3275,7 +3275,7 @@ Wed Jul 21 00:28:03 1993 Tom Lord (lord@unix8.andrew.cmu.edu)
subexpressions to those with shorter ones, giving precedence
to low numbered subexpressions.
* rx.c (re_compile): don't free `params' if its null.
* rx.c (re_compile): don't free 'params' if its null.
Fri Jul 16 01:12:08 1993 Tom Lord (lord@unix8.andrew.cmu.edu)
@ -3325,27 +3325,27 @@ Mon May 17 16:34:50 1993 Tom Lord (lord@unix9.andrew.cmu.edu)
Thu May 6 12:37:18 1993 Tom Lord (lord@unix10.andrew.cmu.edu)
* sed.c (compile_filename, execute_program): don't use
`access' or `/dev/null'.
'access' or '/dev/null'.
* sed.c (execute_program): 'N' at EOF should delete the pat buf.
* sed.c (compile_filename): truncate, don't append files
being openned for `w' or `s///w'
being openned for 'w' or 's///w'
* sed.c (execute_program): -n switch shouldn't effect `i' or `c'.
* sed.c (execute_program): -n switch shouldn't effect 'i' or 'c'.
* sed.c (compile_program): don't compile unescaped newlines
into the substitution string of an `s' command (they are an error).
into the substitution string of an 's' command (they are an error).
* sed.c (compile_regex): correctly skip over character
sets that contain `]'.
sets that contain ']'.
* sed.c (execute_program): patch from gaumondp
Correctly handle empty-string matches in the case of an `s'
Correctly handle empty-string matches in the case of an 's'
command with a repeat count.
* sed.c (compile_program): patch from gaumondp@ere.UMontreal.ca.
Don't consume characters after the label of a `b', `t' or `:' command.
Don't consume characters after the label of a 'b', 't' or ':' command.
* sed.c (compile_program): unmatched open braces are an error.
@ -3369,7 +3369,7 @@ Wed Nov 4 17:15:34 1992 Tom Lord (lord@unix7.andrew.cmu.edu)
with a blank line. Thanks to pinard@iro.umontreal.ca
(Francois Pinard) for pointing out this and many other bugs.
* sed.c (execute_program): Fixed a case of `D' command.
* sed.c (execute_program): Fixed a case of 'D' command.
Thanks Chris Weber <weber@bucknell.edu>
* sed.c: added new tests of no_default_output to make -n work.
@ -3379,7 +3379,7 @@ Wed Nov 4 17:15:34 1992 Tom Lord (lord@unix7.andrew.cmu.edu)
Thanks "J.T. Conklin" <jtc@gain.com>
* sed.c: made prog_cur, prog_start, and prog_end unsigned so
that users could write `sed -e s/ÿ/foo/g'.
that users could write 'sed -e s/ÿ/foo/g'.
Tue Oct 13 00:04:05 1992 Tom Lord (lord@unix3.andrew.cmu.edu)
@ -3418,7 +3418,7 @@ Tue Apr 28 17:13:04 1992 Tom Lord (lord at unix7.andrew.cmu.edu)
Sat Feb 29 10:55:54 1992 David J. MacKenzie (djm@nutrimat)
* sed.c (usage): Document long options as starting with `--'.
* sed.c (usage): Document long options as starting with '--'.
Mon Dec 9 23:56:40 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)

96
NEWS
View File

@ -12,6 +12,12 @@ GNU sed NEWS -*- outline -*-
Internally, 'sed' now more often prefers signed integer arithmetic,
which can be checked automatically via 'gcc -fsanitize=undefined'.
** Changes in behavior
In the default C locale, diagnostics now quote 'like this' (with
apostrophes) instead of `like this' (with a grave accent and an
apostrophe). This tracks the GNU coding standards.
* Noteworthy changes in release 4.9 (2022-11-06) [stable]
@ -250,9 +256,9 @@ GNU sed NEWS -*- outline -*-
* -u also does unbuffered input, rather than unbuffered output only
* New command `F' to print current input file name
* New command 'F' to print current input file name
* sed -i, s///w, and the `w' and `W' commands also obey the --binary option
* sed -i, s///w, and the 'w' and 'W' commands also obey the --binary option
(and create CR/LF-terminated files if the option is absent)
* --posix fails for scripts (or fragments as passed to the -e option) that
@ -279,7 +285,7 @@ Sed 4.2
* now released under GPLv3
* added a new extension `z` to clear pattern space even in the presence
* added a new extension 'z' to clear pattern space even in the presence
of invalid multibyte sequences
* a preexisting GNU gettext installation is needed in order to compile
@ -297,9 +303,9 @@ indistinguishable from a correct implementation.
* multibyte processing fixed
* the following GNU extensions are turned off by --posix: options [iImMsSxX]
in the `s' command, address kinds `FIRST~STEP' and `ADDR1,+N' and `ADDR1,~N',
line address 0, `e' or `z' commands, text between an `a' or `c' or `i'
command and the following backslash, arguments to the `l' command.
in the 's' command, address kinds 'FIRST~STEP' and 'ADDR1,+N' and 'ADDR1,~N',
line address 0, 'e' or 'z' commands, text between an 'a' or 'c' or 'i'
command and the following backslash, arguments to the 'l' command.
--posix disables all extensions to regular expressions.
* fixed bug in 'i\' giving a segmentation violation if given alone.
@ -310,7 +316,7 @@ command and the following backslash, arguments to the `l' command.
* will correctly replace ACLs when using -i
* will now accept NUL bytes for `.'
* will now accept NUL bytes for '.'
----------------------------------------------------------------------------
Sed 4.1.5
@ -329,7 +335,7 @@ Sed 4.1.4
* bugfixes for platform without internationalization
* more thorough testing framework for tarballs (`make full-distcheck')
* more thorough testing framework for tarballs ('make full-distcheck')
----------------------------------------------------------------------------
Sed 4.1.3
@ -339,13 +345,13 @@ Sed 4.1.3
many of them as possible like it used to do.
* added a note to BUGS and the manual about changed interpretation
of `s|abc\|def||', and about localization issues.
of 's|abc\|def||', and about localization issues.
* fixed --disable-nls build problems on Solaris.
* fixed `make check' in non-English locales.
* fixed 'make check' in non-English locales.
* `make check' tests the regex library by default if the included regex
* 'make check' tests the regex library by default if the included regex
is used (regex tests had to be enabled separately up to now).
----------------------------------------------------------------------------
@ -379,21 +385,21 @@ but as soon as more text is sent to the same output stream, the
missing newline is printed, so that the two lines don't concatenate.
The behavior is now independent from POSIXLY_CORRECT because POSIX
actually has undefined behavior in this case, and the new implementation
arguably gives the ``least expected surprise''. Thanks to Stepan
arguably gives the "least expected surprise". Thanks to Stepan
Kasal for the implementation.
* documentation improvements, with updated references to the POSIX.2
specification
* error messages on I/O errors are better, and -i does not leave temporary
files around (e.g. when running ``sed -i'' on a directory).
files around (e.g. when running "sed -i" on a directory).
* escapes are accepted in the y command (for example: y/o/\n/ transforms
o's into newlines)
* -i option tries to set the owner and group to the same as the input file
* `L' command is deprecated and will be removed in sed 4.2.
* 'L' command is deprecated and will be removed in sed 4.2.
* line number addresses are processed differently -- this is supposedly
conformant to POSIX and surely more idiot-proof. Line number addresses
@ -426,10 +432,10 @@ alone).
* when a \ is used to escape the character that would terminate an operand
of the s or y commands, the backslash is removed before the regex is
compiled. This is left undefined by POSIX; this behavior makes `s+x\+++g'
remove occurrences of `x+', consistently with `s/x\///g'. (However, if
you enjoy yourself trying `s*x\***g', sed will use the `x*' regex, and you
won't be able to pass down `x\*' while using * as the delimiter; ideas on
compiled. This is left undefined by POSIX; this behavior makes 's+x\+++g'
remove occurrences of 'x+', consistently with 's/x\///g'. (However, if
you enjoy yourself trying 's*x\***g', sed will use the 'x*' regex, and you
won't be able to pass down 'x\*' while using * as the delimiter; ideas on
how to simplify the parser in this respect, and/or gain more coherent
semantics, are welcome).
@ -445,7 +451,7 @@ Sed 4.0.9
* updated regex matcher from upstream, with many bugfixes and speedups.
* the `N' command's feature that is detailed in the BUGS file was disabled
* the 'N' command's feature that is detailed in the BUGS file was disabled
by the first change below in sed 4.0.8. The behavior has now been
restored, and is only enabled if POSIXLY_CORRECT behavior is not
requested.
@ -453,7 +459,7 @@ requested.
----------------------------------------------------------------------------
Sed 4.0.8
* fix `sed n' printing the last line twice.
* fix 'sed n' printing the last line twice.
* fix incorrect error message for invalid character classes.
@ -482,7 +488,7 @@ a null string (and the infinite loop did not happen :-)
----------------------------------------------------------------------------
Sed 4.0.6
* added parameter to `v' for the version of sed that is expected.
* added parameter to 'v' for the version of sed that is expected.
* configure switch --without-included-regex to use the system regex matcher
@ -494,11 +500,11 @@ Sed 4.0.5
* portability fixes
* improvements to some error messages (e.g. y/abc/defg/ incorrectly said
`excess characters after command' instead of `y arguments have different
'excess characters after command' instead of 'y arguments have different
lengths')
* `a', `i', `l', `L', `r' accept two addresses except in POSIXLY_CORRECT
mode. Only `q' and `Q' do not accept two addresses in standard (GNU) mode.
* 'a', 'i', 'l', 'L', 'r' accept two addresses except in POSIXLY_CORRECT
mode. Only 'q' and 'Q' do not accept two addresses in standard (GNU) mode.
----------------------------------------------------------------------------
Sed 4.0.4
@ -538,25 +544,25 @@ Sed 4.0
----------------------------------------------------------------------------
Sed 3.96
* `y' command supports multibyte character sets
* 'y' command supports multibyte character sets
* Update regex matcher
----------------------------------------------------------------------------
Sed 3.95
* `R' command reads a single line from a file.
* 'R' command reads a single line from a file.
* CR-LF pairs are always ignored under Windows, even if (under Cygwin)
a disk is mounted as binary.
* More attention to errors on stdout
* New `W' command to write first line of pattern space to a file
* New 'W' command to write first line of pattern space to a file
* Can customize line wrap width on single `l' commands
* Can customize line wrap width on single 'l' commands
* `L' command formats and reflows paragraphs like `fmt' does.
* 'L' command formats and reflows paragraphs like 'fmt' does.
* The test suite makefiles are better organized (this change is
transparent however).
@ -564,7 +570,7 @@ transparent however).
* Compiles and bootstraps out-of-the-box under MinGW32 and Cygwin.
* Optimizes cases when pattern space is truncated at its start or at
its end by `D' or by a substitution command with an empty RHS.
its end by 'D' or by a substitution command with an empty RHS.
For example scripts like this,
seq 1 10000 | tr \\n \ | ./sed ':a; s/^[0-9][0-9]* //; ta'
@ -572,10 +578,10 @@ For example scripts like this,
whose behavior was quadratic with previous versions of sed, have
now linear behavior.
* New command `e' to pipe the output of a command into the output
* New command 'e' to pipe the output of a command into the output
of sed.
* New option `e' to pass the output of the `s' command through the
* New option 'e' to pass the output of the 's' command through the
Bourne shell and get the result into pattern space.
* Switched to obstacks in the parser -- less memory-related bugs
@ -589,7 +595,7 @@ not necessary anymore.
bugs in systems with CRLF termination. The current solution is
not definitive, though.
* Bug fix: Made the behavior of s/A*/x/g (i.e. `s' command with a
* Bug fix: Made the behavior of s/A*/x/g (i.e. 's' command with a
possibly empty LHS) more consistent:
pattern GNU sed 3.x GNU sed 4.x
@ -603,10 +609,10 @@ regular expression that was matched, rather than to the last
regular expression that was compiled. This richer behavior seems
to be the correct one (albeit neither one is POSIXLY_CORRECT).
* Check for invalid backreferences in the RHS of the `s' command
* Check for invalid backreferences in the RHS of the 's' command
(e.g. s/1234/\1/)
* Support for \[lLuUE] in the RHS of the `s' command like in Perl.
* Support for \[lLuUE] in the RHS of the 's' command like in Perl.
* New regular expression matcher
@ -614,7 +620,7 @@ to be the correct one (albeit neither one is POSIXLY_CORRECT).
it. So
(sed d; sed G) < TESTFILE
double-spaced TESTFILE, while the equivalent `useless use of cat'
double-spaced TESTFILE, while the equivalent 'useless use of cat'
cat TESTFILE | (sed d; sed G)
printed nothing (which is the correct behavior). A test for this
@ -629,20 +635,20 @@ specific to this version.
-r, --regexp-extended
Use extended regexps -- e.g. (abc+) instead of \(abc\+\)
* Added feature to the `w' command and to the `w' option of the `s'
* Added feature to the 'w' command and to the 'w' option of the 's'
command: if the file name is /dev/stderr, it means the standard
error (inspired by awk); and similarly for /dev/stdout. This is
disabled if POSIXLY_CORRECT is set.
* Added `m' and `M' modifiers to `s' command for multi-line
matching (Perl-style); in addresses, only `M' works.
* Added 'm' and 'M' modifiers to 's' command for multi-line
matching (Perl-style); in addresses, only 'M' works.
* Added `Q' command for `silent quit'; added ability to pass
* Added 'Q' command for 'silent quit'; added ability to pass
an exit code from a sed script to the caller.
* Added `T' command for `branch if failed'.
* Added 'T' command for 'branch if failed'.
* Added `v' command, which is a do-nothing intended to fail on
* Added 'v' command, which is a do-nothing intended to fail on
seds that do not support GNU sed 4.0's extensions.
----------------------------------------------------------------------------
@ -662,7 +668,7 @@ NUL character. Had the glibc folk fix a bug in lib/regex.c where
-u, --unbuffered
Do not attempt to read-ahead more than required; do not buffer stdout.
-l N, --line-length=N
Specify the desired line-wrap length for the `l' command.
Specify the desired line-wrap length for the 'l' command.
A length of "0" means "never wrap".
* New internationalization translations added: fr ru de it el sk pt_BR sv
@ -725,8 +731,8 @@ in a RE matches a NUL; it does not prematurely terminate the RE.
only passes NUL-terminated strings, and so sed will only be able
to see up to the first NUL in any -e scriptlet.)
* Wherever a `;' is accepted as a command terminator, also allow a `}'
or a `#' to appear. (This allows for less cluttered-looking scripts.)
* Wherever a ';' is accepted as a command terminator, also allow a '}'
or a '#' to appear. (This allows for less cluttered-looking scripts.)
* Lots of internal changes that are only relevant to source junkies
and development testing. Some of which might cause imperceptible

6
cfg.mk
View File

@ -242,8 +242,8 @@ sc_prohibit_fail_0:
halt='fail=0 initialization' \
$(_sc_search_regexp)
# Ensure that tests don't use `cmd ... && fail=1` as that hides crashes.
# The "exclude" expression allows common idioms like `test ... && fail=1`
# Ensure that tests don't use 'cmd ... && fail=1' as that hides crashes.
# The "exclude" expression allows common idioms like 'test ... && fail=1'
# and the 2>... portion allows commands that redirect stderr and so probably
# independently check its contents and thus detect any crash messages.
sc_prohibit_and_fail_1:
@ -290,7 +290,7 @@ sc_prohibit_test_backticks:
# so that the unexpected contents are displayed
sc_prohibit_test_empty:
@prohibit='test -s.*&&' in_vc_files='^tests/' \
halt='use `compare /dev/null ...`, not `test -s ...` in tests/' \
halt='use "compare /dev/null ...", not "test -s ..." in tests/' \
$(_sc_search_regexp)
# With split lines, don't leave an operator at end of line.

View File

@ -3397,7 +3397,7 @@ a^c
@c also: this fails in different places:
@c $ sed 's/[//'
@c sed: -e expression #1, char 5: unterminated `s' command
@c sed: -e expression #1, char 5: unterminated 's' command
@c $ sed 's/\x5b//'
@c sed: -e expression #1, char 8: Invalid regular expression
@c
@ -5845,8 +5845,8 @@ sequences. @sc{posix} mandates that such sequences
are @emph{not} matched by @samp{.}, so that @samp{s/.*//} will not clear
pattern space as you would expect. In fact, there is no way to clear
sed's buffers in the middle of the script in most multibyte locales
(including UTF-8 locales). For this reason, @value{SSED} provides a `z'
command (for `zap') as an extension.
(including UTF-8 locales). For this reason, @value{SSED} provides a @code{z}
command (for ``zap'') as an extension.
To work around these problems, which may cause bugs in shell scripts, set
the @env{LC_COLLATE} and @env{LC_CTYPE} environment variables to @samp{C}.

View File

@ -31,7 +31,7 @@ a reminder to those who already know \*(sd;
other documentation (such as the texinfo document)
must be consulted for fuller descriptions.
.SS
Zero-address ``commands''
Zero-address "commands"
.TP
.RI :\ label
Label for
@ -123,10 +123,10 @@ g G
Copy/append hold space to pattern space.
.TP
l
List out the current line in a ``visually unambiguous'' form.
List out the current line in a "visually unambiguous" form.
.TP
.RI l\ width
List out the current line in a ``visually unambiguous'' form,
List out the current line in a "visually unambiguous" form,
breaking it at
.I width
characters. This is a GNU extension.
@ -243,7 +243,7 @@ Match every
.IR step 'th
line starting with line
.IR first .
For example, ``sed \-n 1~2p'' will print all the odd-numbered lines in
For example, "sed \-n 1~2p" will print all the odd-numbered lines in
the input stream, and the address 2~5 will match every fifth line,
starting with the second.
.I first
@ -258,7 +258,7 @@ Match the last line.
Match lines matching the regular expression
.IR regexp .
Matching is performed on the current pattern space, which
can be modified with commands such as ``s///''.
can be modified with commands such as "s///".
.TP
.BI \fR\e\fPc regexp c
Match lines matching the regular expression
@ -334,5 +334,5 @@ http://sed.sf.net/grabbag/.
.PP
E-mail bug reports to
.BR bug-sed@gnu.org .
Also, please include the output of ``sed \-\-version'' in the body
Also, please include the output of "sed \-\-version" in the body
of your report if at all possible.

View File

@ -36,7 +36,7 @@
#define CLOSE_BRACE '}'
struct prog_info {
/* When we're reading a script command from a string, `prog.base'
/* When we're reading a script command from a string, 'prog.base'
points to the first character in the string, 'prog.cur' points
to the current character in the string, and 'prog.end' points
to the end of the string. This allows us to compile script
@ -46,8 +46,8 @@ struct prog_info {
const unsigned char *end;
/* This is the current script file. If it is NULL, we are reading
from a string stored at `prog.cur' instead. If both `prog.file'
and `prog.cur' are NULL, we're in trouble! */
from a string stored at 'prog.cur' instead. If both 'prog.file'
and 'prog.cur' are NULL, we're in trouble! */
FILE *file;
};
@ -68,7 +68,7 @@ struct error_info {
struct sed_label {
idx_t v_index; /* index of vector element being referenced */
char *name; /* NUL-terminated name of the label */
struct error_info err_info; /* track where `{}' blocks start */
struct error_info err_info; /* track where '{}' blocks start */
struct sed_label *next; /* linked list (stack) */
};
@ -171,7 +171,7 @@ inchar (void)
return ch;
}
/* unget `ch' so the next call to inchar will return it. */
/* unget 'ch' so the next call to inchar will return it. */
static void
savchar (int ch)
{
@ -279,7 +279,7 @@ convert_number (char *result, char *buf, const char *bufend, int base)
return p;
}
/* Read in a filename for a `r', `w', or `s///w' command. */
/* Read in a filename for a 'r', 'w', or 's///w' command. */
static struct buffer *
read_filename (void)
{
@ -514,32 +514,32 @@ mark_subst_opts (struct subst *cmd)
case 'i': /* GNU extension */
case 'I': /* GNU extension */
if (posixicity == POSIXLY_BASIC)
bad_prog ("unknown option to `s'");
bad_prog ("unknown option to 's'");
flags |= REG_ICASE;
break;
case 'm': /* GNU extension */
case 'M': /* GNU extension */
if (posixicity == POSIXLY_BASIC)
bad_prog ("unknown option to `s'");
bad_prog ("unknown option to 's'");
flags |= REG_NEWLINE;
break;
case 'e':
if (posixicity == POSIXLY_BASIC)
bad_prog ("unknown option to `s'");
bad_prog ("unknown option to 's'");
cmd->eval = true;
break;
case 'p':
if (cmd->print)
bad_prog ("multiple `p' options to `s' command");
bad_prog ("multiple 'p' options to 's' command");
cmd->print |= (1 << cmd->eval); /* 1=before eval, 2=after */
break;
case 'g':
if (cmd->global)
bad_prog ("multiple `g' options to `s' command");
bad_prog ("multiple 'g' options to 's' command");
cmd->global = true;
break;
@ -550,10 +550,10 @@ mark_subst_opts (struct subst *cmd)
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
if (cmd->numb)
bad_prog ("multiple number options to `s' command");
bad_prog ("multiple number options to 's' command");
cmd->numb = in_integer (ch);
if (!cmd->numb)
bad_prog ("number option to `s' command may not be zero");
bad_prog ("number option to 's' command may not be zero");
break;
case CLOSE_BRACE:
@ -571,12 +571,12 @@ mark_subst_opts (struct subst *cmd)
FALLTHROUGH;
default:
bad_prog ("unknown option to `s'");
bad_prog ("unknown option to 's'");
/*NOTREACHED*/
}
}
/* read in a label for a `:', `b', or `t' command */
/* read in a label for a ':', 'b', or 't' command */
static char * _GL_ATTRIBUTE_MALLOC
read_label (void)
{
@ -598,10 +598,10 @@ read_label (void)
return ret;
}
/* Store a label (or label reference) created by a `:', `b', or `t'
/* Store a label (or label reference) created by a ':', 'b', or 't'
command so that the jump to/from the label can be backpatched after
compilation is complete, or a reference created by a `{' to be
backpatched when the corresponding `}' is found. */
compilation is complete, or a reference created by a '{' to be
backpatched when the corresponding '}' is found. */
static struct sed_label *
setup_label (struct sed_label *list, idx_t idx, char *name,
const struct error_info *err_info)
@ -803,7 +803,7 @@ read_text (struct text_buf *buf, int leadin_ch)
}
/* Try to read an address for a sed command. If it succeeds,
return non-zero and store the resulting address in `*addr'.
return non-zero and store the resulting address in '*addr'.
If the input doesn't look like an address read nothing
and return zero. */
static bool
@ -887,8 +887,8 @@ compile_address (struct addr *addr, int ch)
return true;
}
/* Read a program (or a subprogram within `{' `}' pairs) in and store
the compiled form in `*vector'. Return a pointer to the new vector. */
/* Read a program (or a subprogram within '{' '}' pairs) in and store
the compiled form in '*vector'. Return a pointer to the new vector. */
static struct vector *
compile_program (struct vector *vector)
{
@ -929,7 +929,7 @@ compile_program (struct vector *vector)
if (ch == ',')
{
if (!compile_address (&a, in_nonblank ()))
bad_prog ("unexpected `,'");
bad_prog ("unexpected ','");
cur_cmd->a2 = MEMDUP (&a, 1, struct addr);
ch = in_nonblank ();
@ -947,7 +947,7 @@ compile_program (struct vector *vector)
cur_cmd->addr_bang = true;
ch = in_nonblank ();
if (ch == '!')
bad_prog ("multiple `!'s");
bad_prog ("multiple '!'s");
}
/* Do not accept extended commands in --posix mode. Also,
@ -957,7 +957,7 @@ compile_program (struct vector *vector)
{
case 'e': case 'F': case 'v': case 'z': case 'L':
case 'Q': case 'T': case 'R': case 'W':
bad_prog ("unknown command: `%c'", ch);
bad_prog ("unknown command: '%c'", ch);
FALLTHROUGH;
case 'a': case 'i': case 'l':
@ -983,7 +983,7 @@ compile_program (struct vector *vector)
case 'v':
/* This is an extension. Programs needing GNU sed might start
* with a `v' command so that other seds will stop.
* with a 'v' command so that other seds will stop.
* We compare the version and ignore POSIXLY_CORRECT.
*/
{
@ -1005,9 +1005,9 @@ compile_program (struct vector *vector)
case '}':
if (!blocks)
bad_prog ("unexpected `}'");
bad_prog ("unexpected '}'");
if (cur_cmd->a1)
bad_prog ("`}' doesn't want any addresses");
bad_prog ("'}' doesn't want any addresses");
read_end_of_cmd ();
@ -1035,14 +1035,14 @@ compile_program (struct vector *vector)
read_text_to_slash:
if (ch == EOF)
bad_prog ("expected \\ after `a', `c' or `i'");
bad_prog ("expected \\ after 'a', 'c' or 'i'");
if (ch == '\\')
ch = inchar ();
else
{
if (posixicity == POSIXLY_BASIC)
bad_prog ("expected \\ after `a', `c' or `i'");
bad_prog ("expected \\ after 'a', 'c' or 'i'");
savchar (ch);
ch = '\n';
}
@ -1148,9 +1148,9 @@ compile_program (struct vector *vector)
slash = inchar ();
if ( !(b = match_slash (slash, true)) )
bad_prog ("unterminated `s' command");
bad_prog ("unterminated 's' command");
if ( !(b2 = match_slash (slash, false)) )
bad_prog ("unterminated `s' command");
bad_prog ("unterminated 's' command");
cur_cmd->x.cmd_subst = OB_MALLOC (&obs, 1, struct subst);
setup_replacement (cur_cmd->x.cmd_subst,
@ -1176,12 +1176,12 @@ compile_program (struct vector *vector)
slash = inchar ();
if ( !(b = match_slash (slash, false)) )
bad_prog ("unterminated `y' command");
bad_prog ("unterminated 'y' command");
src_buf = get_buffer (b);
len = normalize_text (src_buf, size_buffer (b), TEXT_BUFFER);
if ( !(b2 = match_slash (slash, false)) )
bad_prog ("unterminated `y' command");
bad_prog ("unterminated 'y' command");
dest_buf = get_buffer (b2);
dest_len = normalize_text (dest_buf, size_buffer (b2), TEXT_BUFFER);
@ -1219,7 +1219,7 @@ compile_program (struct vector *vector)
for (i = 0; i < src_char_num; i++)
{
if (idx >= dest_len)
bad_prog ("`y' command strings have different lengths");
bad_prog ("'y' command strings have different lengths");
/* Set the i-th source character. */
trans_pairs[2 * i] = XNMALLOC (src_lens[i] + 1, char);
@ -1243,7 +1243,7 @@ compile_program (struct vector *vector)
}
trans_pairs[2 * i] = NULL;
if (idx != dest_len)
bad_prog ("`y' command strings have different lengths");
bad_prog ("'y' command strings have different lengths");
IF_LINT (free (src_lens));
}
@ -1254,7 +1254,7 @@ compile_program (struct vector *vector)
unsigned char *ustring = (unsigned char *)src_buf;
if (len != dest_len)
bad_prog ("`y' command strings have different lengths");
bad_prog ("'y' command strings have different lengths");
for (len = 0; len < YMAP_LENGTH; len++)
translate[len] = len;
@ -1277,7 +1277,7 @@ compile_program (struct vector *vector)
/*NOTREACHED*/
default:
bad_prog ("unknown command: `%c'", ch);
bad_prog ("unknown command: '%c'", ch);
/*NOTREACHED*/
}
@ -1419,8 +1419,8 @@ convert:
}
/* `str' is a string (from the command line) that contains a sed command.
Compile the command, and add it to the end of `cur_program'. */
/* 'str' is a string (from the command line) that contains a sed command.
Compile the command, and add it to the end of 'cur_program'. */
struct vector *
compile_string (struct vector *cur_program, char *str, idx_t len)
{
@ -1445,8 +1445,8 @@ compile_string (struct vector *cur_program, char *str, idx_t len)
return ret;
}
/* `cmdfile' is the name of a file containing sed commands.
Read them in and add them to the end of `cur_program'.
/* 'cmdfile' is the name of a file containing sed commands.
Read them in and add them to the end of 'cur_program'.
*/
struct vector *
compile_file (struct vector *cur_program, const char *cmdfile)
@ -1512,7 +1512,7 @@ check_final_program (struct vector *program)
{
/* update info for error reporting: */
memcpy (&cur_input, &blocks->err_info, sizeof (cur_input));
bad_prog ("unmatched `{'");
bad_prog ("unmatched '{'");
}
/* was the final command an unterminated a/c/i command? */
@ -1538,7 +1538,7 @@ check_final_program (struct vector *program)
else
{
if (*go->name)
panic (_("can't find label for jump to `%s'"), go->name);
panic (_("can't find label for jump to '%s'"), go->name);
program->v[go->v_index].x.jump_index = program->v_length;
}
}

View File

@ -105,13 +105,13 @@ struct input {
};
/* Have we done any replacements lately? This is used by the `t' command. */
/* Have we done any replacements lately? This is used by the 't' command. */
static bool replaced = false;
/* The current output file (stdout if -i is not being used). */
static struct output output_file;
/* The `current' input line. */
/* The 'current' input line. */
static struct line line;
/* An input line used to accumulate the result of the s and e commands. */
@ -273,7 +273,7 @@ str_append_modified (struct line *to, const char *string, idx_t length,
}
}
/* Initialize a "struct line" buffer. Copy multibyte state from `state'
/* Initialize a "struct line" buffer. Copy multibyte state from 'state'
if not null. */
static void
line_init (struct line *buf, struct line *state, idx_t initial_size)
@ -291,7 +291,7 @@ line_init (struct line *buf, struct line *state, idx_t initial_size)
}
/* Reset a "struct line" buffer to length zero. Copy multibyte state from
`state' if not null. */
'state' if not null. */
static void
line_reset (struct line *buf, struct line *state)
{
@ -307,9 +307,9 @@ line_reset (struct line *buf, struct line *state)
}
}
/* Copy the contents of the line `from' into the line `to'.
This destroys the old contents of `to'.
Copy the multibyte state if `state' is true. */
/* Copy the contents of the line 'from' into the line 'to'.
This destroys the old contents of 'to'.
Copy the multibyte state if 'state' is true. */
static void
line_copy (struct line *from, struct line *to, int state)
{
@ -335,8 +335,8 @@ line_copy (struct line *from, struct line *to, int state)
memcpy (&to->mbstate, &from->mbstate, sizeof (from->mbstate));
}
/* Append the contents of the line `from' to the line `to'.
Copy the multibyte state if `state' is true. */
/* Append the contents of the line 'from' to the line 'to'.
Copy the multibyte state if 'state' is true. */
static void
line_append (struct line *from, struct line *to, int state)
{
@ -349,7 +349,7 @@ line_append (struct line *from, struct line *to, int state)
}
/* Exchange two "struct line" buffers.
Copy the multibyte state if `state' is true. */
Copy the multibyte state if 'state' is true. */
static void
line_exchange (struct line *a, struct line *b, int state)
{
@ -773,7 +773,7 @@ last_file_with_data_p (struct input *input)
}
}
/* Determine if we match the `$' address. */
/* Determine if we match the '$' address. */
static bool
test_eof (struct input *input)
{
@ -792,7 +792,7 @@ test_eof (struct input *input)
}
/* Return non-zero if the current line matches the address
pointed to by `addr'. */
pointed to by 'addr'. */
static bool
match_an_address_p (struct addr *addr, struct input *input)
{
@ -894,7 +894,7 @@ match_address_p (struct sed_cmd *cmd, struct input *input)
{
/* If the second address is a line number, and if we got past
that line, fail to match (it can happen when you jump
over such addresses with `b' and `t'. Use RANGE_CLOSED
over such addresses with 'b' and 't'. Use RANGE_CLOSED
so that the range is not re-enabled anymore. */
if (input->line_number >= cmd->a2->addr_number)
cmd->range_state = RANGE_CLOSED;
@ -923,7 +923,7 @@ do_list (intmax_t line_len)
char *o = obuf;
/* Some locales define 8-bit characters as printable. This makes the
testsuite fail at 8to7.sed because the `l' command in fact will not
testsuite fail at 8to7.sed because the 'l' command in fact will not
convert the 8-bit characters. */
#if defined isascii || defined HAVE_ISASCII
if (isascii (*p) && ISPRINT (*p)) {
@ -1053,7 +1053,7 @@ do_subst (struct subst *sub)
{
if (regs.start[0] == 0 && !sub->global)
{
/* We found a match, set the `replaced' flag. */
/* We found a match, set the 'replaced' flag. */
replaced = true;
line.active += regs.end[0];
@ -1063,7 +1063,7 @@ do_subst (struct subst *sub)
}
else if (regs.end[0] == line.length)
{
/* We found a match, set the `replaced' flag. */
/* We found a match, set the 'replaced' flag. */
replaced = true;
line.length = regs.start[0];
@ -1089,13 +1089,13 @@ do_subst (struct subst *sub)
another match?
This latter case avoids that baaaac, when passed through
s,a*,x,g, gives `xbxxcx' instead of xbxcx. This behavior is
s,a*,x,g, gives 'xbxxcx' instead of xbxcx. This behavior is
unacceptable because it is not consistently applied (for
example, `baaaa' gives `xbx', not `xbxx'). */
example, 'baaaa' gives 'xbx', not 'xbxx'). */
if ((matched > 0 || count == 0 || offset > last_end)
&& ++count >= sub->numb)
{
/* We found a match, set the `replaced' flag. */
/* We found a match, set the 'replaced' flag. */
replaced = true;
/* Now expand the replacement string into the output string. */
@ -1178,7 +1178,7 @@ do_subst (struct subst *sub)
else
panic (_("error in subprocess"));
#else
panic (_("option `e' not supported"));
panic (_("option 'e' not supported"));
#endif
}
@ -1205,7 +1205,7 @@ translate_mb (char *const *trans)
if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
mbclen = 1;
/* `i' indicate i-th translate pair. */
/* 'i' indicate i-th translate pair. */
for (i = 0; trans[2*i] != NULL; i++)
{
if (STREQ_LEN (line.active + idx, trans[2*i], mbclen))
@ -1276,7 +1276,7 @@ debug_print_line (struct line *ln)
putchar ('\n');
}
/* Execute the program `vec' on the current input line.
/* Execute the program 'vec' on the current input line.
Return exit status if caller should quit, -1 otherwise. */
static int
execute_program (struct vector *vec, struct input *input)
@ -1351,7 +1351,7 @@ execute_program (struct vector *vec, struct input *input)
case 'e': {
#ifndef HAVE_POPEN
panic (_("`e' command not supported"));
panic (_("'e' command not supported"));
#else
FILE *pipe_fp;
idx_t cmd_length = cur_cmd->x.cmd_txt.text_length;
@ -1387,7 +1387,7 @@ execute_program (struct vector *vec, struct input *input)
pclose (pipe_fp);
if (!cmd_length)
{
/* Store into pattern space for plain `e' commands */
/* Store into pattern space for plain 'e' commands */
if (s_accum.length
&& (s_accum.active[s_accum.length - 1]
== buffer_delimiter))

View File

@ -107,7 +107,7 @@ compile_regex_1 (struct regex *new_regex, int needed_sub)
if (needed_sub
&& new_regex->pattern.re_nsub < needed_sub - 1
&& posixicity == POSIXLY_EXTENDED)
bad_prog ("invalid reference \\%d on `s' command's RHS", needed_sub - 1);
bad_prog ("invalid reference \\%d on 's' command's RHS", needed_sub - 1);
int dfaopts = buffer_delimiter == '\n' ? 0 : DFA_EOL_NUL;
new_regex->dfa = dfaalloc ();

View File

@ -80,7 +80,7 @@ bool binary_mode = false;
/* Do we need to be pedantically POSIX compliant? */
enum posixicity_types posixicity;
/* How long should the `l' command's output line be? */
/* How long should the 'l' command's output line be? */
intmax_t lcmd_out_line_len = 70;
/* The complete compiled SED program that we are going to run: */
@ -104,7 +104,7 @@ contact (int errmsg)
fprintf (out, _("GNU sed home page: <https://www.gnu.org/software/sed/>.\n\
General help using GNU software: <https://www.gnu.org/gethelp/>.\n"));
/* Only print the bug report address for `sed --help', otherwise we'll
/* Only print the bug report address for 'sed --help', otherwise we'll
get reports for other people's bugs. */
if (!errmsg)
fprintf (out, _("E-mail bug reports to: <%s>.\n"), PACKAGE_BUGREPORT);
@ -156,7 +156,7 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\
" processed specially)\n"));
#endif
fprintf (out, _(" -l N, --line-length=N\n\
specify the desired line-wrap length for the `l' command\n"));
specify the desired line-wrap length for the 'l' command\n"));
fprintf (out, _(" --posix\n\
disable all GNU extensions.\n"));
fprintf (out, _(" -E, -r, --regexp-extended\n\
@ -248,8 +248,8 @@ main (int argc, char **argv)
else
posixicity = POSIXLY_EXTENDED;
/* If environment variable `COLS' is set, use its value for
the baseline setting of `lcmd_out_line_len'. The "-1"
/* If environment variable 'COLS' is set, use its value for
the baseline setting of 'lcmd_out_line_len'. The "-1"
is to avoid gratuitous auto-line-wrap on ttys.
*/
if (cols)

View File

@ -238,7 +238,7 @@ extern bool follow_symlinks;
/* Do we need to be pedantically POSIX compliant? */
extern enum posixicity_types posixicity;
/* How long should the `l' command's output line be? */
/* How long should the 'l' command's output line be? */
extern idx_t lcmd_out_line_len;
/* How do we edit files in-place? (we don't if NULL) */

View File

@ -416,7 +416,7 @@ ck_rename (const char *from, const char *to)
/* Implement a variable sized buffer of `stuff'. We don't know what it is,
/* Implement a variable sized buffer of 'stuff'. We don't know what it is,
nor do we care, as long as it doesn't mind being aligned by malloc. */
struct buffer

View File

@ -21,7 +21,7 @@
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE

View File

@ -31,7 +31,7 @@ printf '1\n1\n2\n2\n' > exp-no-posix || framework_failure_
#
# using "--posix" disables the backref safety check in
# regexp.c:compile_regex_1(), which is reported as:
# "invalid reference \\%d on `s' command's RHS"
# "invalid reference \\%d on 's' command's RHS"
valgrind --quiet --error-exitcode=1 \
sed --posix -e '/2/p ; 2s//\9/' in > out-posix 2> err-posix || fail=1

View File

@ -22,7 +22,7 @@ print_ver_ sed
# Excess P modifier to s// (EXCESS_P_OPT)
#
cat <<\EOF >exp-exs-p || framework_failure_
sed: -e expression #1, char 8: multiple `p' options to `s' command
sed: -e expression #1, char 8: multiple 'p' options to 's' command
EOF
returns_ 1 sed 's/./x/pp' </dev/null 2>err-exs-p || fail=1
compare_ exp-exs-p err-exs-p || fail=1
@ -31,7 +31,7 @@ compare_ exp-exs-p err-exs-p || fail=1
# Excess G modifier to s// (EXCESS_G_OPT)
#
cat <<\EOF >exp-exs-g || framework_failure_
sed: -e expression #1, char 8: multiple `g' options to `s' command
sed: -e expression #1, char 8: multiple 'g' options to 's' command
EOF
returns_ 1 sed 's/./x/gg' </dev/null 2>err-exs-g || fail=1
compare_ exp-exs-g err-exs-g || fail=1
@ -40,7 +40,7 @@ compare_ exp-exs-g err-exs-g || fail=1
# zero numeric modifier to s// (ZERO_N_OPT)
#
cat <<\EOF >exp-exs-0 || framework_failure_
sed: -e expression #1, char 7: number option to `s' command may not be zero
sed: -e expression #1, char 7: number option to 's' command may not be zero
EOF
returns_ 1 sed 's/./x/0' </dev/null 2>err-exs-0 || fail=1
compare_ exp-exs-0 err-exs-0 || fail=1
@ -50,7 +50,7 @@ compare_ exp-exs-0 err-exs-0 || fail=1
# Multiple number modifiers to s// (EXCESS_N_OPT)
#
cat <<\EOF >exp-exs-n || framework_failure_
sed: -e expression #1, char 9: multiple number options to `s' command
sed: -e expression #1, char 9: multiple number options to 's' command
EOF
returns_ 1 sed 's/./x/2p3' </dev/null 2>err-exs-n || fail=1
compare_ exp-exs-n err-exs-n || fail=1
@ -60,7 +60,7 @@ compare_ exp-exs-n err-exs-n || fail=1
# Unknown s/// modifier letter
#
cat << \EOF >exp-unk-s-opt || framework_failure_
sed: -e expression #1, char 7: unknown option to `s'
sed: -e expression #1, char 7: unknown option to 's'
EOF
returns_ 1 sed 's/./x/Q' </dev/null 2>err-unk-s-opt || fail=1
compare_ exp-unk-s-opt err-unk-s-opt || fail=1
@ -70,7 +70,7 @@ compare_ exp-unk-s-opt err-unk-s-opt || fail=1
#
printf "s/./x/\r" > s-opt-r-in || framework_failure_
cat << \EOF >exp-s-opt-r || framework_failure_
sed: file s-opt-r-in line 1: unknown option to `s'
sed: file s-opt-r-in line 1: unknown option to 's'
EOF
returns_ 1 sed -f s-opt-r-in </dev/null 2>err-s-opt-r || fail=1
compare_ exp-s-opt-r err-s-opt-r || fail=1
@ -92,7 +92,7 @@ compare_ exp-step-addr err-step-addr2 || fail=1
# Multiple '!' (BAD_BANG)
#
cat <<\EOF >exp-bad-bang || framework_failure_
sed: -e expression #1, char 3: multiple `!'s
sed: -e expression #1, char 3: multiple '!'s
EOF
returns_ 1 sed '1!!d' </dev/null 2>err-bad-bang || fail=1
compare_ exp-bad-bang err-bad-bang || fail=1
@ -104,7 +104,7 @@ compare_ exp-bad-bang err-bad-bang || fail=1
for opt in e F v z L Q T R W ;
do
cat <<EOF >exp-posix-cmd-$opt || framework_failure_
sed: -e expression #1, char 2: unknown command: \`$opt'
sed: -e expression #1, char 2: unknown command: '$opt'
EOF
returns_ 1 sed --posix "1$opt" </dev/null 2>err-posix-cmd-$opt || fail=1
compare_ exp-posix-cmd-$opt err-posix-cmd-$opt || fail=1
@ -143,7 +143,7 @@ compare_ exp-no-sharp err-no-sharp || fail=1
# Unexpected closing braces (EXCESS_CLOSE_BRACE)
#
cat <<\EOF >exp-unexp-brace || framework_failure_
sed: -e expression #1, char 2: unexpected `}'
sed: -e expression #1, char 2: unexpected '}'
EOF
returns_ 1 sed '1}' </dev/null 2>err-unexp-brace || fail=1
compare_ exp-unexp-brace err-unexp-brace || fail=1
@ -153,7 +153,7 @@ compare_ exp-unexp-brace err-unexp-brace || fail=1
# Umatched opening braces (EXCESS_OPEN_BRACE)
# TODO: why 'char 0' ?
cat <<\EOF >exp-unmatched-braces || framework_failure_
sed: -e expression #1, char 0: unmatched `{'
sed: -e expression #1, char 0: unmatched '{'
EOF
returns_ 1 sed '1{' </dev/null 2>err-unmatched-braces || fail=1
compare_ exp-unmatched-braces err-unmatched-braces || fail=1
@ -163,7 +163,7 @@ compare_ exp-unmatched-braces err-unmatched-braces || fail=1
# '}' with address (NO_CLOSE_BRACE_ADDR)
#
cat <<\EOF >exp-brace-addr || framework_failure_
sed: -e expression #1, char 3: `}' doesn't want any addresses
sed: -e expression #1, char 3: '}' doesn't want any addresses
EOF
returns_ 1 sed '{1}' </dev/null 2>err-brace-addr || fail=1
compare_ exp-brace-addr err-brace-addr || fail=1
@ -201,7 +201,7 @@ compare_ exp-junk err-junk-braces || fail=1
# Slash after a/c/i (EXPECTED_SLASH)
# note: GNU extensions are less strict than --posix.
cat <<\EOF >exp-junk || framework_failure_
sed: -e expression #1, char 2: expected \ after `a', `c' or `i'
sed: -e expression #1, char 2: expected \ after 'a', 'c' or 'i'
EOF
for opt in a c i ;
do
@ -245,7 +245,7 @@ compare_ exp-colon-addr err-colon-addr || fail=1
# in multiple places due to varied conditions - check them all.
# dummy addresses ensures the offending character is always 5.
cat <<\EOF >exp-unterm-y || framework_failure_
sed: -e expression #1, char 5: unterminated `y' command
sed: -e expression #1, char 5: unterminated 'y' command
EOF
returns_ 1 sed '1111y' </dev/null 2>err-unterm-y1 || fail=1
compare_ exp-unterm-y err-unterm-y1 || fail=1
@ -262,7 +262,7 @@ compare_ exp-unterm-y err-unterm-y5 || fail=1
# Y command with bad legth (Y_CMD_LEN)
# TODO: check with multibyte strings.
cat <<\EOF >exp-bad-y-len || framework_failure_
sed: -e expression #1, char 7: `y' command strings have different lengths
sed: -e expression #1, char 7: 'y' command strings have different lengths
EOF
returns_ 1 sed 'y/a/bb/' </dev/null 2>err-bad-y-len || fail=1
compare_ exp-bad-y-len err-bad-y-len || fail=1

View File

@ -83,7 +83,7 @@ compare_ exp-err-op-bracket err-op-bracket2 || fail=1
# unterminated character class '[.'
# (snarf_char_class terminates on char 7, then returns)
cat <<\EOF >exp-chr-class || framework_failure_
sed: -e expression #1, char 7: unterminated `s' command
sed: -e expression #1, char 7: unterminated 's' command
EOF
returns_ 1 sed 's/[[.//' </dev/null 2>err-chr-class || fail=1
compare_ exp-chr-class err-chr-class || fail=1
@ -92,7 +92,7 @@ compare_ exp-chr-class err-chr-class || fail=1
# closing bracket immediately after char-class opening
# sequence (e.g. '[:]' instead of '[:alpha:]' ).
cat<< \EOF >exp-chr-class2 || framework_failure_
sed: -e expression #1, char 9: unterminated `s' command
sed: -e expression #1, char 9: unterminated 's' command
EOF
returns_ 1 sed 's/[[:]]//' </dev/null 2>err-chr-class2 || fail=1
compare_ exp-chr-class2 err-chr-class2 || fail=1

View File

@ -205,7 +205,7 @@ EXTRA_DIST += \
testsuite/xemacs.good \
testsuite/xemacs.inp
# automake makes `check' depend on $(TESTS). Declare
# automake makes 'check' depend on $(TESTS). Declare
# dummy targets for $(TESTS) so that make does not complain.
.PHONY: $(SEDTESTS)

View File

@ -50,7 +50,7 @@ compare_ exp1 out1 || fail=1
# in C locale, report error of mismatched length
cat <<\EOF > exp-err1 || framework_failure_
sed: file p1 line 1: `y' command strings have different lengths
sed: file p1 line 1: 'y' command strings have different lengths
EOF
returns_ 1 env LC_ALL=C sed -f p1 </dev/null 2>err1 || fail=1
compare_ exp-err1 err1 || fail=1
@ -68,7 +68,7 @@ compare_ exp2 out2 || fail=1
# in C locale, report error of mismatched length
cat <<\EOF > exp-err2 || framework_failure_
sed: file p2 line 1: `y' command strings have different lengths
sed: file p2 line 1: 'y' command strings have different lengths
EOF
returns_ 1 env LC_ALL=C sed -f p2 </dev/null 2>err2 || fail=1
compare_ exp-err2 err2 || fail=1
@ -116,7 +116,7 @@ done
# multibyte themselves.
printf 'y/abc/d/' > p7 || framework_failure_
cat <<\EOF > exp-err7 || framework_failure_
sed: file p7 line 1: `y' command strings have different lengths
sed: file p7 line 1: 'y' command strings have different lengths
EOF
returns_ 1 env LC_ALL=en_US.UTF-8 sed -f p7 </dev/null 2>err7 || fail=1
@ -124,7 +124,7 @@ compare_ exp-err7 err7 || fail=1
printf 'y/a/bcd/' > p8 || framework_failure_
cat <<\EOF > exp-err8 || framework_failure_
sed: file p8 line 1: `y' command strings have different lengths
sed: file p8 line 1: 'y' command strings have different lengths
EOF
returns_ 1 env LC_ALL=en_US.UTF-8 sed -f p8 </dev/null 2>err8 || fail=1

View File

@ -257,7 +257,7 @@ s/[[[[[[[[[]/h/
],
['fasts',
# test `fast' substitutions
# test 'fast' substitutions
qw(-f),
{IN => q(
h
@ -1049,7 +1049,7 @@ foo foo fo oo f oo foo foo foo foo foo foo foo foo foo foo foo foo foo
/too\.$/q
)},
{AUX => { 'readin.in2' => "MOO\n" }},
{IN => "``Democracy will not come today, this year,\n"
{IN => " \"Democracy will not come today, this year,\n"
. " nor ever through compromise and fear.\n"
. " I have as much right as the other fellow has\n"
. " to stand on my two feet and own the land.\n"
@ -1061,9 +1061,9 @@ foo foo fo oo f oo foo foo foo foo foo foo foo foo foo foo foo foo foo
. " Freedom is a strong seed\n"
. " planted in a great need.\n"
. " I live here, too.\n"
. " I want freedom just as you.''\n"
. " ``The Weary Blues'', Langston Hughes\n"},
{OUT => "``Democracy will not come today, this year,\n"
. " I want freedom just as you.\"\n"
. " \"The Weary Blues\", Langston Hughes\n"},
{OUT => " \"Democracy will not come today, this year,\n"
. " nor ever through compromise and fear.\n"
. "MOO\n"
. " I have as much right as the other fellow has\n"

View File

@ -73,7 +73,7 @@ compare_ exp3 out3 || fail=1
# TODO: is this a bug?
# compare with 'y/a/\d/' and 'y/a/\x/'
cat <<\EOF >exp-err-c || framework_failure_
sed: -e expression #1, char 7: `y' command strings have different lengths
sed: -e expression #1, char 7: 'y' command strings have different lengths
EOF
returns_ 1 sed 'y/a/\c/' </dev/null 2>err-c || fail=1
compare_ exp-err-c err-c || fail=1

View File

@ -23,7 +23,7 @@ sed: -e expression #1, char 6: invalid usage of line address 0
EOF
cat <<\EOF >exp-err-bad-addr || framework_failure_
sed: -e expression #1, char 3: unexpected `,'
sed: -e expression #1, char 3: unexpected ','
EOF
printf "%s\n" A B A C D E F G H I J >in1 || framework_failure_

View File

@ -19,7 +19,7 @@
print_ver_ sed
cat <<\EOF >exp-err || framework_failure_
sed: -e expression #1, char 10: invalid reference \1 on `s' command's RHS
sed: -e expression #1, char 10: invalid reference \1 on 's' command's RHS
EOF
# Invalid references are errors in non-posix mode

View File

@ -19,7 +19,7 @@
print_ver_ sed
cat <<\EOF >exp-err || framework_failure_
sed: -e expression #1, char 7: unknown option to `s'
sed: -e expression #1, char 7: unknown option to 's'
EOF
# substitution command options (
@ -48,7 +48,7 @@ compare exp-gnu-e out-gnu-e || fail=1
# s///e rejected in POSIX mode
cat <<\EOF >exp-err-psx-e || framework_failure_
sed: -e expression #1, char 10: unknown option to `s'
sed: -e expression #1, char 10: unknown option to 's'
EOF
returns_ 1 sed --posix 's/./echo/e' in1 2>err-posix-e || fail=1
compare_ exp-err-psx-e err-posix-e || fail=1