From ea6a7135f12fef6444458dc2f2c5c6c308e063be Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 23 Feb 2019 15:44:46 -0500 Subject: [PATCH] redoconf: avoid sed -E in _objlist(). Turns out there's a less confusing way to do it using 'case' wildcards instead. Reported-by: Wayne Scott --- redoconf/default.do.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/redoconf/default.do.sh b/redoconf/default.do.sh index 6c4de48..76cb10d 100644 --- a/redoconf/default.do.sh +++ b/redoconf/default.do.sh @@ -65,13 +65,18 @@ _pick_src() { } _objlist() { - local suffix="$1" list="$2" base="${2##*/}" + local suffix="$1" list="$2" + local base="${2##*/}" local dir="${2%"$base"}" - sed -Ee 's/\.(c|cc|cpp|cxx|C|c\+\+)$/'"$suffix/" <"$2" | while read -r d; do - [ "$d" = "${d#-}" ] || continue - echo "$dir$d" - done + case $d in + -*) ;; + *.c|*.cc|*.cpp|*.cxx|*.C|*.c++) + echo "$dir${d%.*}$suffix" + ;; + *) echo "$dir$d" ;; + esac + done <"$list" } _flaglist() {