From c538c3a709552912ebce960922c569d46def35ac Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 22 Aug 2014 15:40:28 -0400 Subject: feed_para_cb(): Trim multiple spaces --- (limited to 'lib') diff --git a/lib/feed.sh b/lib/feed.sh index 3805bf0..feaf7ba 100644 --- a/lib/feed.sh +++ b/lib/feed.sh @@ -122,9 +122,11 @@ feed_para_cb() dep="${dep%%(*}" dep="${dep%%|*}" # Trim whitespace. - # XXX: This doesn't actually trim multiple spaces. - dep="${dep##[ ${HT}${LF}]}" - dep="${dep%%[ ${HT}${LF}]}" + dep="$(printf '%s\n' "${dep}" | sed 's/^ *//; s/ *$//')" + # In practice, this would suffice for control files generated by + # opkbuild: + # dep="${dep#[ ${HT}${LF}]}" + # dep="${dep%[ ${HT}${LF}]}" new_deps="${new_deps} ${dep}" done unset IFS -- cgit v0.9.1