diff --git a/pkgs/opengl/insert-virtualgl.sh b/pkgs/opengl/insert-virtualgl.sh index 993bb0f..b411c02 100755 --- a/pkgs/opengl/insert-virtualgl.sh +++ b/pkgs/opengl/insert-virtualgl.sh @@ -7,13 +7,13 @@ VGL_quote() { # Stream producers # -# These produce a stream of escaped new-line separated items +# These produce a stream of escaped new-line terminated items # # Stream the given arguments # VGL_sourceS() { - printf '%q\n' "$@" + (( $# == 0 )) || printf '%q\n' "$@" } # Stream the results of find (correctly escapes all filenames) @@ -61,15 +61,16 @@ VGL_elfRPathS() { declare file=$1 entry patchelf --print-rpath "$file" | while read -d ':' -r entry; do - VGL_sourceS "$entry" + [[ -z $entry ]] || VGL_sourceS "$entry" done + [[ -z $entry ]] || VGL_sourceS "$entry" } # Stream transformers # -# Take in a set of options and transform a stream of new-line separated items +# Take in a set of options and transform to a stream of new-line terminated items # # Remove all items for which the given command returns false @@ -111,7 +112,7 @@ VGL_testSuffixNoneS() { # Stream consumers # -# These consume a stream of escaped new-line separated items +# These consume a stream of escaped new-line terminated items (termination is required for processing) # # Return true iff given command returns true for some item