+2025-08-11 Bruno Haible <bruno@clisp.org>
+
+ nlcanon: Make it work on OpenBSD.
+ * build-aux/nlcanon.sh.in (sed_convert_crlf): New variable. Use it
+ instead of a sed script that contains '\r'.
+
2025-08-10 Bruno Haible <bruno@clisp.org>
Use standard way of including <config.h>.
trap 'exit_status=$?; func_cleanup_tmpfiles; exit $exit_status' EXIT
exitcode_file="$tmp/exit"
+ # Need to use printf, because OpenBSD and Solaris 'sed' don't interpret \r
+ # as an escape sequence.
+ sed_convert_crlf='s/'`printf '\r'`'$//'
+
# This is not a program. This is art. :D)
case "$streams" in
stdout)
- { "$@"; echo "$?" > "$exitcode_file"; } | { sed -e 's/\r$//' 2>/dev/null; }
+ { "$@"; echo "$?" > "$exitcode_file"; } | { sed -e "$sed_convert_crlf" 2>/dev/null; }
;;
stderr)
- { { "$@" 2>&1 1>&3; echo "$?" > "$exitcode_file"; } | { sed -e 's/\r$//' 2>/dev/null; }; } 3>&1 1>&2
+ { { "$@" 2>&1 1>&3; echo "$?" > "$exitcode_file"; } | { sed -e "$sed_convert_crlf" 2>/dev/null; }; } 3>&1 1>&2
;;
*) # both
- { { "$@" 2>&1 1>&3; echo "$?" > "$exitcode_file"; } | { sed -e 's/\r$//' 2>/dev/null; }; } 3>&1 1>&2 | { sed -e 's/\r$//' 2>/dev/null; }
+ { { "$@" 2>&1 1>&3; echo "$?" > "$exitcode_file"; } | { sed -e "$sed_convert_crlf" 2>/dev/null; }; } 3>&1 1>&2 | { sed -e "$sed_convert_crlf" 2>/dev/null; }
;;
esac
exit `cat "$exitcode_file"`