Let --posix turn off nonportable scripts ending in backslash.

* sed/compile.c (errors, INCOMPLETE_CMD): New error string.
(compile_program): In strict posix mode, complain about incomplete
command.
* NEWS: Update.
Report by Bruno Haible.
This commit is contained in:
Ralf Wildenhues authored and Paolo Bonzini committed 2010-08-17 01:56:36 +02:00
1 parent a85e83d0db
commit fbf10902f7
3 files changed
+18 -2

No files matched your search

+9
View File
@@ -1,3 +1,12 @@
2019-07-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Let --posix turn off nonportable scripts ending in backslash.
* sed/compile.c (errors, INCOMPLETE_CMD): New error string.
(compile_program): In strict posix mode, complain about incomplete
command.
* NEWS: Update.
Report by Bruno Haible.
2010-07-16 Paolo Bonzini <bonzini@gnu.org>
* autoboot.conf (gnulib_modules): Replace mkstemp with mkostemp.
+3
View File
@@ -8,6 +8,9 @@ Sed 4.2.2
* -i does not convert the input file to binary (LF-terminated) on Cygwin
* --posix fails for scripts (or fragments as passed to the -e option) that
end in a backslash, as they are not portable.
----------------------------------------------------------------------------
Sed 4.2.1
+6 -2
View File
@@ -155,7 +155,8 @@ static const char errors[] =
"delimiter character is not a single-byte character\0"
"expected newer version of sed\0"
"invalid usage of line address 0\0"
"unknown command: `%c'";
"unknown command: `%c'\0"
"incomplete command";
#define BAD_BANG (errors)
#define BAD_COMMA (BAD_BANG + sizeof(N_("multiple `!'s")))
@@ -182,7 +183,8 @@ static const char errors[] =
#define ANCIENT_VERSION (BAD_DELIM + sizeof(N_("delimiter character is not a single-byte character")))
#define INVALID_LINE_0 (ANCIENT_VERSION + sizeof(N_("expected newer version of sed")))
#define UNKNOWN_CMD (INVALID_LINE_0 + sizeof(N_("invalid usage of line address 0")))
#define END_ERRORS (UNKNOWN_CMD + sizeof(N_("unknown command: `%c'")))
#define INCOMPLETE_CMD (UNKNOWN_CMD + sizeof(N_("unknown command: `%c'")))
#define END_ERRORS (INCOMPLETE_CMD + sizeof(N_("incomplete command")))
static struct output *file_read = NULL;
static struct output *file_write = NULL;
@@ -1404,6 +1406,8 @@ compile_program(vector)
/* this is buried down here so that "continue" statements will miss it */
++vector->v_length;
}
if (posixicity == POSIXLY_BASIC && pending_text)
bad_prog (_(INCOMPLETE_CMD));
return vector;
}