From: W. Felix Handte Date: Tue, 5 May 2020 18:54:04 +0000 (-0400) Subject: Fix Sed Regex Escaping for Extended Regex Rules...... X-Git-Tag: v1.4.5^2~43^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=005ffd3bdb14edc2cf21d8902266f21494127968;p=thirdparty%2Fzstd.git Fix Sed Regex Escaping for Extended Regex Rules...... --- diff --git a/contrib/single_file_libs/combine.sh b/contrib/single_file_libs/combine.sh index 7c12fcdeb..2fef0541c 100755 --- a/contrib/single_file_libs/combine.sh +++ b/contrib/single_file_libs/combine.sh @@ -46,7 +46,7 @@ test_deps() { echo "Aborting: the grep implementation fails to parse include lines" exit 1 fi - if ! echo '"foo.h"' | sed 's/"\([^"]\+\)"/\1/' | grep -Eq '^foo\.h$'; then + if ! echo '"foo.h"' | sed -E 's/"([^"]+)"/\1/' | grep -Eq '^foo\.h$'; then echo "Aborting: sed is unavailable or non-functional" exit 1 fi @@ -120,7 +120,7 @@ add_file() { while IFS= read -r line; do if echo "$line" | grep -Eq '^\s*#\s*include\s*".+"'; then # We have an include directive so strip the (first) file - local inc=$(echo "$line" | grep -Eo '".*"' | sed 's/"\([^"]\+\)"/\1/' | head -1) + local inc=$(echo "$line" | grep -Eo '".*"' | sed -E 's/"([^"]+)"/\1/' | head -1) local res_inc="$(resolve_include "$srcdir" "$inc")" if list_has_item "$XINCS" "$inc"; then # The file was excluded so error if the source attempts to use it