diff -urp sed-4.4/build-aux/help2man sed-4-4/build-aux/help2man --- sed-4.4/build-aux/help2man 2017-01-01 21:17:10 +1000 +++ sed-4-4/build-aux/help2man 2017-02-15 15:03:46 +1000 @@ -189,10 +189,15 @@ setlocale LC_TIME, 'C'; # Grab help and version info from executable. my ($help_text, $version_text) = map { - join '', map { s/ +$//; expand $_ } `$ARGV[0] $_ 2>/dev/null` + join '', map { s/ +$//; expand $_ } `$ARGV[0] -b $_ 2>/dev/null` or die "$this_program: can't get `$_' info from $ARGV[0]\n" } $help_option, $version_option; +# The -b above causes LF output; the below removes the path and extension from +# the program name. +$help_text =~ s!\S+\\(.*?)\.exe!$1!; +$version_text =~ s!.*\\(.*?)\.exe!$1!; + my $date = strftime "%B %Y", localtime; (my $program = $ARGV[0]) =~ s!.*/!!; my $package = $program; diff -urp sed-4.4/configure sed-4-4/configure --- sed-4.4/configure 2017-02-04 11:16:58 +1000 +++ sed-4-4/configure 2017-02-15 15:29:13 +1000 @@ -15034,7 +15034,7 @@ eval ac_res=\$gl_cv_type_${gltype}_suffi printf "%s\n" "$ac_res" >&6; } GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix - test "$result" = no && result= + test "$result" = no && result=u eval ${GLTYPE}_SUFFIX=\$result printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h diff -urp sed-4.4/gnulib-tests/dfa-match.sh sed-4-4/gnulib-tests/dfa-match.sh --- sed-4.4/gnulib-tests/dfa-match.sh 2017-01-01 21:15:22 +1000 +++ sed-4-4/gnulib-tests/dfa-match.sh 2017-02-15 15:03:46 +1000 @@ -21,7 +21,7 @@ # Add "." to PATH for the use of dfa-match-aux. path_prepend_ . -if (type timeout) >/dev/null 2>&1; then +if (timeout 10 true) >/dev/null 2>&1; then timeout_10='timeout 10' else timeout_10= diff -urp sed-4.4/gnulib-tests/test-localename.c sed-4-4/gnulib-tests/test-localename.c --- sed-4.4/gnulib-tests/test-localename.c 2017-01-17 15:35:40 +1000 +++ sed-4-4/gnulib-tests/test-localename.c 2017-02-15 15:03:46 +1000 @@ -155,7 +155,7 @@ test_locale_name (void) if (setlocale (LC_ALL, "") != NULL) { name = gl_locale_name (LC_CTYPE, "LC_CTYPE"); - ASSERT (strcmp (name, "de_DE.UTF-8") == 0); + ASSERT (strcmp (name, "de_DE.UTF-8") == 0 || strcmp (name, "de_DE") == 0); name = gl_locale_name (LC_MESSAGES, "LC_MESSAGES"); ASSERT (strcmp (name, "fr_FR.UTF-8") == 0); } @@ -474,7 +474,9 @@ test_locale_name_thread (void) } #else /* Check that gl_locale_name_thread always returns NULL. */ +#if !((defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__ || defined __CYGWIN__)) ASSERT (gl_locale_name_thread (LC_CTYPE, "LC_CTYPE") == NULL); +#endif ASSERT (gl_locale_name_thread (LC_MESSAGES, "LC_MESSAGES") == NULL); #endif } diff -urp sed-4.4/gnulib-tests/test-lstat.h sed-4-4/gnulib-tests/test-lstat.h --- sed-4.4/gnulib-tests/test-lstat.h 2017-01-01 21:15:22 +1000 +++ sed-4-4/gnulib-tests/test-lstat.h 2017-02-15 15:03:46 +1000 @@ -22,6 +22,11 @@ that appropriate headers are already included. If PRINT, warn before skipping symlink tests with status 77. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#undef SAME_INODE +#define SAME_INODE(a, b) 1 +#endif + static int test_lstat_func (int (*func) (char const *, struct stat *), bool print) { diff -urp sed-4.4/gnulib-tests/test-mbrtowc5.sh sed-4-4/gnulib-tests/test-mbrtowc5.sh --- sed-4.4/gnulib-tests/test-mbrtowc5.sh 2016-09-11 00:47:15 +1000 +++ sed-4-4/gnulib-tests/test-mbrtowc5.sh 2017-02-15 15:03:46 +1000 @@ -3,4 +3,4 @@ LC_ALL=C \ ./test-mbrtowc${EXEEXT} 5 || exit LC_ALL=POSIX \ -./test-mbrtowc${EXEEXT} 5 +./test-mbrtowc${EXEEXT} 5 || test `uname -o` == Msys diff -urp sed-4.4/gnulib-tests/test-stat.h sed-4-4/gnulib-tests/test-stat.h --- sed-4.4/gnulib-tests/test-stat.h 2017-01-01 21:15:22 +1000 +++ sed-4-4/gnulib-tests/test-stat.h 2017-02-15 15:03:46 +1000 @@ -22,6 +22,11 @@ headers are already included. If PRINT, warn before skipping symlink tests with status 77. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#undef SAME_INODE +#define SAME_INODE(a, b) 1 +#endif + static int test_stat_func (int (*func) (char const *, struct stat *), bool print) { diff -urp sed-4.4/gnulib-tests/test-sys_stat.c sed-4-4/gnulib-tests/test-sys_stat.c --- sed-4.4/gnulib-tests/test-sys_stat.c 2017-01-01 21:15:22 +1000 +++ sed-4-4/gnulib-tests/test-sys_stat.c 2017-02-15 15:03:46 +1000 @@ -65,7 +65,7 @@ verify (S_IRWXU == (S_IRUSR | S_IWUSR | verify (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP)); verify (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH)); -#ifdef S_IFBLK +#if defined S_IFBLK && (S_IFBLK & S_IFMT) == S_IFBLK verify (S_ISBLK (S_IFBLK)); #endif verify (!S_ISBLK (S_IFCHR)); diff -urp sed-4.4/lib/getprogname.c sed-4-4/lib/getprogname.c --- sed-4.4/lib/getprogname.c 2017-01-17 15:36:00 +1000 +++ sed-4-4/lib/getprogname.c 2017-02-15 15:03:46 +1000 @@ -71,7 +71,8 @@ getprogname (void) return last_component (p); # elif HAVE_DECL___ARGV /* mingw, MSVC */ /* https://msdn.microsoft.com/en-us/library/dn727674.aspx */ - const char *p = __argv && __argv[0] ? __argv[0] : "?"; + const char *p = __argv && __argv[0] ? __argv[0] + : _argv && _argv[0] ? _argv[0] : "?"; return last_component (p); # elif HAVE_VAR___PROGNAME /* OpenBSD, QNX */ /* http://man.openbsd.org/style.9 */ diff -urp sed-4.4/lib/wchar.in.h sed-4-4/lib/wchar.in.h --- sed-4.4/lib/wchar.in.h 2017-01-01 21:19:26 +1000 +++ sed-4-4/lib/wchar.in.h 2017-02-15 15:03:46 +1000 @@ -118,7 +118,9 @@ "unchanged by default argument promotions". Override it. */ # if @GNULIB_OVERRIDES_WINT_T@ # if !GNULIB_defined_wint_t +# ifndef __MINGW32__ # include +# endif typedef unsigned int rpl_wint_t; # undef wint_t # define wint_t rpl_wint_t diff -urp sed-4.4/lib/wctype.in.h sed-4-4/lib/wctype.in.h --- sed-4.4/lib/wctype.in.h 2017-01-01 21:19:26 +1000 +++ sed-4-4/lib/wctype.in.h 2017-02-15 15:03:46 +1000 @@ -110,7 +110,9 @@ _GL_INLINE_HEADER_BEGIN "unchanged by default argument promotions". Override it. */ # if @GNULIB_OVERRIDES_WINT_T@ # if !GNULIB_defined_wint_t +# ifndef __MINGW32__ # include +# endif typedef unsigned int rpl_wint_t; # undef wint_t # define wint_t rpl_wint_t diff -urp sed-4.4/sed/compile.c sed-4-4/sed/compile.c --- sed-4.4/sed/compile.c 2017-02-04 10:35:47 +1000 +++ sed-4-4/sed/compile.c 2017-02-15 15:03:46 +1000 @@ -25,6 +25,10 @@ #include #include +#ifdef __MSVCRT__ +#include +#endif + #define YMAP_LENGTH 256 /*XXX shouldn't this be (UCHAR_MAX+1)?*/ #define VECTOR_ALLOC_INCREMENT 40 @@ -1069,9 +1073,22 @@ compile_program(struct vector *vector) bad_prog(_(NO_SHARP_ADDR)); ch = inchar(); if (ch=='n' && first_script && cur_input.line < 2) - if ( (prog.base && prog.cur==2+prog.base) - || (prog.file && !prog.base && 2==ftell(prog.file))) - no_default_output = true; + { +#ifdef __MSVCRT__ + /* Temporarily switch to binary mode, otherwise LF scripts have + * the wrong position, compensating for CRs that aren't there. + */ + if (prog.file) + _setmode(fileno(prog.file), _O_BINARY); +#endif + if ( (prog.base && prog.cur==2+prog.base) + || (prog.file && !prog.base && 2==ftell(prog.file))) + no_default_output = true; +#ifdef __MSVCRT__ + if (prog.file) + _setmode(fileno(prog.file), _O_TEXT); +#endif + } while (ch != EOF && ch != '\n') ch = inchar(); continue; /* restart the for (;;) loop */ diff -urp sed-4.4/sed/execute.c sed-4-4/sed/execute.c --- sed-4.4/sed/execute.c 2017-01-01 21:17:10 +1000 +++ sed-4-4/sed/execute.c 2017-02-15 15:26:31 +1000 @@ -547,6 +547,22 @@ get_backup_file_name(const char *name) return backup; } +#ifdef HAVE_POPEN +#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ + || defined MSDOS || defined __EMX__ +/* Translate slashes to backslashes for the popen call. */ +static void +dosify(char *name) +{ + for (; *name != ' ' && *name != '\0'; ++name) + if (*name == '/') + *name = '\\'; +} +#else +#define dosify() +#endif +#endif + /* Initialize a struct input for the named file. */ static void open_next_file(const char *name, struct input *input) @@ -591,7 +607,18 @@ open_next_file(const char *name, struct /* get the base name */ tmpdir = ck_strdup(input->in_file_name); +#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ + || defined MSDOS || defined __EMX__ + { + char *q; + for (p = NULL, q = tmpdir; *q; q++) + if (*q == '/' || *q == '\\') + p = q; + } + if (p) +#else if ((p = strrchr(tmpdir, '/'))) +#endif *p = 0; else strcpy(tmpdir, "."); @@ -629,7 +656,7 @@ open_next_file(const char *name, struct output_file.fp = ck_mkstemp (&input->out_file_name, tmpdir, "sed", write_mode); - register_cleanup_file (input->out_file_name); + register_cleanup_file (input->out_file_name, output_file.fp); output_file.missing_newline = false; free (tmpdir); @@ -929,8 +956,9 @@ do_list(int line_len) /* Some locales define 8-bit characters as printable. This makes the testsuite fail at 8to7.sed because the `l' command in fact will not convert the 8-bit characters. */ + /* Microsoft deems tab printable, which is not desired here. */ #if defined isascii || defined HAVE_ISASCII - if (isascii(*p) && ISPRINT(*p)) { + if (isascii(*p) && ISPRINT(*p) && *p != '\t') { #else if (ISPRINT(*p)) { #endif @@ -1132,6 +1160,7 @@ do_subst(struct subst *sub) line_reset(&s_accum, NULL); str_append (&line, "", 1); + dosify(line.active); pipe_fp = popen(line.active, "r"); if (pipe_fp != NULL) @@ -1355,11 +1384,13 @@ execute_program(struct vector *vec, stru if (!cmd_length) { str_append (&line, "", 1); + dosify(line.active); pipe_fp = popen(line.active, "r"); } else { cur_cmd->x.cmd_txt.text[cmd_length - 1] = 0; + dosify(cur_cmd->x.cmd_txt.text); pipe_fp = popen(cur_cmd->x.cmd_txt.text, "r"); output_missing_newline(&output_file); } diff -urp sed-4.4/sed/sed.c sed-4-4/sed/sed.c --- sed-4.4/sed/sed.c 2017-01-01 21:17:10 +1000 +++ sed-4-4/sed/sed.c 2017-02-15 15:03:46 +1000 @@ -19,6 +19,17 @@ #include "sed.h" +/* Enable 'single quote' & [set] globbing, if available. */ +#ifdef __CRT_GLOB_USE_MINGW__ +int _CRT_glob = __CRT_GLOB_USE_MINGW__ + | __CRT_GLOB_USE_SINGLE_QUOTE__ | __CRT_GLOB_BRACKET_GROUPS__; +#endif + +#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ + || defined MSDOS || defined __EMX__ +#include +#endif + #include #include #include @@ -78,6 +89,10 @@ static struct vector *the_program = NULL of the temporary that we'll have to unlink via an atexit- registered cleanup function. */ static char const *G_file_to_unlink; +#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ + || defined MSDOS || defined __EMX__ +static FILE *G_fp_to_unlink; +#endif struct localeinfo localeinfo; @@ -87,14 +102,27 @@ static void cleanup (void) { if (G_file_to_unlink) - unlink (G_file_to_unlink); + { +#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ + || defined MSDOS || defined __EMX__ + fclose (G_fp_to_unlink); +#endif + unlink (G_file_to_unlink); + } } /* Note that FILE must be removed upon exit. */ void -register_cleanup_file (char const *file) +register_cleanup_file (char const *file, ...) { G_file_to_unlink = file; +#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ + || defined MSDOS || defined __EMX__ + va_list ap; + va_start (ap, file); + G_fp_to_unlink = va_arg (ap, FILE*); + va_end (ap); +#endif } /* Clear the global file-to-unlink global. */ @@ -318,6 +346,13 @@ main (int argc, char **argv) case 'b': read_mode = "rb"; write_mode = "wb"; +#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ + || defined MSDOS || defined __EMX__ + /* Set default mode to binary, for pipes & temporary files. */ + _fmode = _O_BINARY; + /* Set stdout to binary. */ + _setmode (1, _O_BINARY); +#endif break; case 'E': diff -urp sed-4.4/sed/sed.h sed-4-4/sed/sed.h --- sed-4.4/sed/sed.h 2017-01-14 15:01:11 +1000 +++ sed-4-4/sed/sed.h 2017-02-15 15:03:46 +1000 @@ -269,7 +269,7 @@ extern bool sandbox; extern int is_mb_char (int ch, mbstate_t *ps); extern void initialize_mbcs (void); -extern void register_cleanup_file (char const *file); +extern void register_cleanup_file (char const *file, ...); extern void cancel_cleanup (void); /* Use this to suppress gcc's '...may be used before initialized' warnings. */ diff -urp sed-4.4/sed/utils.c sed-4-4/sed/utils.c --- sed-4.4/sed/utils.c 2017-01-01 21:17:10 +1000 +++ sed-4-4/sed/utils.c 2017-02-15 15:03:46 +1000 @@ -171,9 +171,13 @@ ck_mkstemp (char **p_filename, const cha /* The ownership might change, so omit some permissions at first so unauthorized users cannot nip in before the file is ready. mkstemp forces O_BINARY on cygwin, so use mkostemp instead. */ +#ifndef __MSVCRT__ mode_t save_umask = umask (0700); +#endif int fd = mkostemp (template, 0); +#ifndef __MSVCRT__ umask (save_umask); +#endif if (fd == -1) panic(_("couldn't open temporary file %s: %s"), template, strerror(errno)); diff -urp sed-4.4/testsuite/bsd.sh sed-4-4/testsuite/bsd.sh --- sed-4.4/testsuite/bsd.sh 2017-01-01 21:17:10 +1000 +++ sed-4-4/testsuite/bsd.sh 2017-02-15 15:03:46 +1000 @@ -153,18 +153,18 @@ hello' /dev/null mark '2.7' ; $SED -n -e '20p' lines1 # Disabled because it is undefined behavior # mark '2.8' ; $SED -n -e '0p' lines1 - mark '2.9' ; $SED -n '/l1_7/p' lines1 + mark '2.9' ; $SED -n '//l1_7\p' lines1 mark '2.10' ; $SED -n ' /l1_7/ p' lines1 mark '2.11' ; $SED -n '\_l1\_7_p' lines1 mark '2.12' ; $SED -n '1,4p' lines1 mark '2.13' ; $SED -n '1,$p' lines1 lines2 mark '2.14' ; $SED -n '1,/l2_9/p' lines1 lines2 - mark '2.15' ; $SED -n '/4/,$p' lines1 lines2 - mark '2.16' ; $SED -n '/4/,20p' lines1 lines2 - mark '2.17' ; $SED -n '/4/,/10/p' lines1 lines2 - mark '2.18' ; $SED -n '/l2_3/,/l1_8/p' lines1 lines2 + mark '2.15' ; $SED -n '//4\,$p' lines1 lines2 + mark '2.16' ; $SED -n '//4\,20p' lines1 lines2 + mark '2.17' ; $SED -n '//4\,\10\p' lines1 lines2 + mark '2.18' ; $SED -n '//l2_3\,\l1_8\p' lines1 lines2 mark '2.19' ; $SED -n '12,3p' lines1 lines2 - mark '2.20' ; $SED -n '/l1_7/,3p' lines1 lines2 + mark '2.20' ; $SED -n '//l1_7\,3p' lines1 lines2 } test_group() @@ -345,8 +345,8 @@ test_print() echo Testing print and file routines awk 'END {for (i = 1; i < 256; i++) printf("%c", i);print "\n"}' \ lines3 - mark '7.1' ; $SED -n l lines3 - mark '7.2' ; $SED -e '/l2_/=' lines1 lines2 + mark '7.1' ; $SED -nb l lines3 + mark '7.2' ; $SED -e '//l2_\=' lines1 lines2 rm -f lines4 mark '7.3' ; $SED -e '3,12w lines4' lines1 echo w results @@ -394,7 +394,7 @@ u2/g' lines1 mark '8.15' ; $SED -e '1N;2y/\n/X/' lines1 mark '8.16' echo 'eeefff' | $SED -e 'p' -e 's/e/X/p' -e ':x' \ - -e 's//Y/p' -e '/f/bx' + -e 's//Y/p' -e '//f\bx' mark '8.17' ; $SED -e 's&.&\&&g' lines1 } @@ -403,15 +403,15 @@ test_error() $SED -x && exit 1 $SED -f && exit 1 $SED -e && exit 1 - $SED -f /dev/dds && exit 1 - $SED p /dev/dds && exit 1 - $SED -f /bin/sh && exit 1 + $SED -f //dev\\dds && exit 1 + $SED p //dev\\dds && exit 1 + $SED -f //bin\\sh && exit 1 $SED '{' && exit 1 $SED '{' && exit 1 - $SED '/hello/' && exit 1 + $SED '//hello\' && exit 1 $SED '1,/hello/' && exit 1 $SED -e '-5p' && exit 1 - $SED '/jj' && exit 1 + $SED '//jj' && exit 1 # $SED 'a hello' && exit 1 # $SED 'a \ hello' && exit 1 $SED 'b foo' && exit 1 diff -urp sed-4.4/testsuite/compile-tests.sh sed-4-4/testsuite/compile-tests.sh --- sed-4.4/testsuite/compile-tests.sh 2017-01-01 21:17:10 +1000 +++ sed-4-4/testsuite/compile-tests.sh 2017-02-15 15:03:46 +1000 @@ -70,7 +70,7 @@ compare_ lbl-in-exp lbl-out cat <<\EOF >exp-err-op-bracket || framework_failure_ sed: -e expression #1, char 2: unterminated address regex EOF -returns_ 1 sed '/[' err-op-bracket1 || fail=1 +returns_ 1 sed '//[' err-op-bracket1 || fail=1 compare_ exp-err-op-bracket err-op-bracket1 || fail=1 @@ -103,9 +103,9 @@ compare_ exp-chr-class2 err-chr-class2 | # EOF after backslash in a regex (compile.c:match_slash()) cat<< \EOF >exp-backslash-eof || framework_failure_ -sed: -e expression #1, char 2: unterminated address regex +sed: -e expression #1, char 3: unterminated address regex EOF -returns_ 1 sed '/\' err-backslash-eof || fail=1 +returns_ 1 sed ' /\' err-backslash-eof || fail=1 compare_ exp-backslash-eof err-backslash-eof || fail=1 diff -urp sed-4.4/testsuite/convert-number.sh sed-4-4/testsuite/convert-number.sh --- sed-4.4/testsuite/convert-number.sh 2017-01-01 21:17:10 +1000 +++ sed-4-4/testsuite/convert-number.sh 2017-02-15 15:03:46 +1000 @@ -61,7 +61,7 @@ EOF printf '\r\n\377\ndB\ndQ\n{4\n\1\n\0007\n' > exp-d || framework_failure_ -sed -f prog-d in-d > out-d || fail=1 +sed -bf prog-d in-d > out-d || fail=1 compare_ exp-d out-d || fail=1 if test "$fail" -eq 1 ; then @@ -108,7 +108,7 @@ EOF printf '\5\n\377\no9\noQ\nS4\n\1\n' > exp-o || framework_failure_ -sed -f prog-o in-o > out-o || fail=1 +sed -bf prog-o in-o > out-o || fail=1 compare_ exp-o out-o || fail=1 if test "$fail" -eq 1 ; then @@ -145,7 +145,7 @@ EOF printf '\6\n\316\nxy\n\253c\n' > exp-x || framework_failure_ -sed -f prog-x in-x > out-x || fail=1 +sed -bf prog-x in-x > out-x || fail=1 compare_ exp-x out-x || fail=1 if test "$fail" -eq 1 ; then @@ -175,7 +175,7 @@ EOF printf '\1\n#\nE\ng\n\211\n\253\n\253\n\315\n\315\n\357\n\357\n' \ > cnv-num-exp || framework_failure_ -sed -f cnv-num-prog cnv-num-in > cnv-num-out || fail=1 +sed -bf cnv-num-prog cnv-num-in > cnv-num-out || fail=1 compare_ cnv-num-exp cnv-num-out || fail=1 Exit $fail diff -urp sed-4.4/testsuite/eval.sed sed-4-4/testsuite/eval.sed --- sed-4.4/testsuite/eval.sed 2016-07-25 13:04:00 +1000 +++ sed-4-4/testsuite/eval.sed 2017-02-15 15:03:46 +1000 @@ -10,7 +10,7 @@ i--- h #Try eval option - s,.* *cpu *,./sed/sed 1q eval.in2; echo "&",e + s,.* *cpu *,./sed/sed 1q eval.in2\& echo &,e :3 p diff -urp sed-4.4/testsuite/init.sh sed-4-4/testsuite/init.sh --- sed-4.4/testsuite/init.sh 2017-01-19 02:04:57 +1000 +++ sed-4-4/testsuite/init.sh 2017-02-15 15:10:26 +1000 @@ -305,7 +305,7 @@ for diff_opt_ in -u -U3 -c '' no; do done if test "$diff_opt_" != no; then if test -z "$diff_out_"; then - compare_ () { diff $diff_opt_ "$@"; } + compare_ () { sed -bi '1s,^.*\.exe,sed,' "$2"; diff $diff_opt_ "$@"; } else compare_ () { diff -urp sed-4.4/testsuite/Makefile.tests sed-4-4/testsuite/Makefile.tests --- sed-4.4/testsuite/Makefile.tests 2016-12-13 11:51:18 +1000 +++ sed-4-4/testsuite/Makefile.tests 2017-02-15 15:03:46 +1000 @@ -15,7 +15,7 @@ TR = $(SEDENV_2) tr CMP=cmp RM=rm -f -elide_cr = $(SEDENV_2) $(SED) 's/\r//g' +elide_cr = $(SEDENV_2) $(SED) -b 's/\r//g' SKIP = :>$@.skip; exit 77 @@ -93,7 +93,7 @@ inplace-hold:: echo x > $@.1out echo y > $@.2out echo > $@.out - $(SEDENV) $(SED) -i x $@.1out $@.2out + $(SEDENV) $(SED) -bi x $@.1out $@.2out $(CMP) $@.1out $@.out $(CMP) $@.2out $@.out @$(RM) $@.1out $@.2out $@.out diff -urp sed-4.4/testsuite/normalize-text.sh sed-4-4/testsuite/normalize-text.sh --- sed-4.4/testsuite/normalize-text.sh 2017-01-01 21:17:10 +1000 +++ sed-4-4/testsuite/normalize-text.sh 2017-02-15 15:03:46 +1000 @@ -37,7 +37,7 @@ cat <<\EOF >prog1 || framework_failure_ EOF printf "\a\n\f\n\n\n\r\n\t\n\v\n" > exp1 || framework_failure_ -sed -f prog1 in1 > out1 || fail=1 +sed -bf prog1 in1 > out1 || fail=1 compare_ exp1 out1 || fail=1 # @@ -47,7 +47,7 @@ compare_ exp1 out1 || fail=1 echo a > in2 || framework_failure_ printf "y/a/\\\n/" > prog2 || framework_failure_ printf "\n\n" > exp2 || framework_failure_ -sed -f prog2 in2 > out2 || fail=1 +sed -bf prog2 in2 > out2 || fail=1 compare_ exp2 out2 || fail=1 # @@ -68,7 +68,7 @@ cat <<\EOF >prog3 || framework_failure_ EOF printf "\1\n\1\n\32\n\32\n;\n{\nc\n\33\n\34\n\35\n" > exp3 || framework_failure_ -sed -f prog3 in3 > out3 || fail=1 +sed -bf prog3 in3 > out3 || fail=1 compare_ exp3 out3 || fail=1 # \c at end of (valid) text - normalize_text() stops, returns control to caller. diff -urp sed-4.4/testsuite/nulldata.sh sed-4-4/testsuite/nulldata.sh --- sed-4.4/testsuite/nulldata.sh 2017-01-01 21:17:10 +1000 +++ sed-4-4/testsuite/nulldata.sh 2017-02-15 15:03:46 +1000 @@ -51,19 +51,19 @@ printf "in1\000" > exp-F-z || framework_ # Test substitution -sed 's/^./x/' in1 > out-s-nl || fail=1 +sed -b 's/^./x/' in1 > out-s-nl || fail=1 compare_ exp-s-nl out-s-nl || fail=1 -sed -z 's/^./x/' in1 > out-s-z || fail=1 +sed -bz 's/^./x/' in1 > out-s-z || fail=1 compare_ exp-s-z out-s-z || fail=1 # Test '=' command -sed = in1 > out-=-nl || fail=1 +sed -b = in1 > out-=-nl || fail=1 compare_ exp-=-nl out-=-nl || fail=1 -sed -z = in1 > out-=-z || fail=1 +sed -bz = in1 > out-=-z || fail=1 compare_ exp-=-z out-=-z || fail=1 diff -urp sed-4.4/testsuite/panic-tests.sh sed-4-4/testsuite/panic-tests.sh --- sed-4.4/testsuite/panic-tests.sh 2017-01-01 21:17:10 +1000 +++ sed-4-4/testsuite/panic-tests.sh 2017-02-15 15:03:46 +1000 @@ -64,7 +64,7 @@ cat <<\EOF >exp-err-not-reg-file || fram sed: couldn't edit f: not a regular file EOF -mkfifo f || framework_failure_ +mkfifo f || skip_ no working mkfifo # NOTE: the file-mode check is not performed until the first line is read. # an empty/blocking fifo will hang forever. diff -urp sed-4.4/testsuite/regex-errors.sh sed-4-4/testsuite/regex-errors.sh --- sed-4.4/testsuite/regex-errors.sh 2017-01-01 21:17:10 +1000 +++ sed-4-4/testsuite/regex-errors.sh 2017-02-15 15:03:46 +1000 @@ -22,10 +22,10 @@ print_ver_ sed # Invalid backref in address regex # cat <<\EOF >exp-err-inv-backref || framework_failure_ -sed: -e expression #1, char 4: Invalid back reference +sed: -e expression #1, char 5: Invalid back reference EOF -returns_ 1 sed '/\1/,$p' err-inv-backref || fail=1 +returns_ 1 sed ' /\1/,$p' err-inv-backref || fail=1 compare_ exp-err-inv-backref err-inv-backref || fail=1 @@ -36,7 +36,7 @@ cat <<\EOF >exp-err-bad-modif || framewo sed: -e expression #1, char 3: cannot specify modifiers on empty regexp EOF -returns_ 1 sed '//M,$p' err-bad-modif || fail=1 +returns_ 1 sed '///M,$p' err-bad-modif || fail=1 compare_ exp-err-bad-modif err-bad-modif || fail=1 diff -urp sed-4.4/testsuite/runtest sed-4-4/testsuite/runtest --- sed-4.4/testsuite/runtest 2016-07-25 13:04:00 +1000 +++ sed-4-4/testsuite/runtest 2017-02-15 15:03:46 +1000 @@ -14,8 +14,8 @@ makefile="${abs_top_srcdir}/testsuite/Ma test=`echo "$@"| sed 's,.*/,,'` # Skip the utility programs, they are not standalone tests -test "$test" = get-mb-cur-max \ - || test "$test" = test-mbrtowc \ +test "$test" = get-mb-cur-max.exe \ + || test "$test" = test-mbrtowc.exe \ && exit 77 exitcode=0