On 8/21/20 3:35 PM, Stefano Garzarella wrote:
If there are less than 2 arguments in version_ge(), the second
'shift' prints this error:
     ../configure: line 232: shift: shift count out of range

As Eric suggested, we can use 'shift ${2:+2}' which works out to
'shift 2' if $2 is set, or 'shift' (implicitly shift 1) if $2
is not set.

This patch replaces both 'shift; shift' occurrences in version_ge()
with 'shift ${2:+2}'.

Suggested-by: Eric Blake <ebl...@redhat.com>
Signed-off-by: Stefano Garzarella <sgarz...@redhat.com>
---
v3:
- use Eric's one-liner solution
v2:
- do not shift if there are no more arguments [Peter]
---
  configure | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <ebl...@redhat.com>


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


Reply via email to