diff --git a/init.cfg b/init.cfg index 915a260..a15041c 100644 --- a/init.cfg +++ b/init.cfg @@ -110,3 +110,13 @@ require_valid_ja_eucjp_locale_() local n=$(printf '\262C' | LC_ALL="$1" test-mbrtowc) test "x$n" = "x-2,-1" || skip_ "locale '$1' is buggy" } + +# When testing on a Windows machine, sed might output +# line endings as CR,LF (\r\n) pairs - which will +# then fail comparison with the expected output files. +# +# This function removes the CR (\r) characters from the given input file. +remove_cr_inplace() +{ + sed -i -e "s/\r//g" "$@" || framework_failure_ +}