From: Orestis Date: Fri, 15 Sep 2017 09:21:35 +0000 (+0300) Subject: Use numeric comparison in sort for $displaynum (#2952) X-Git-Tag: 4.15~85 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=00912add46242f05bb9a1ca032dc3da5ed3919dd;p=i3%2Fi3 Use numeric comparison in sort for $displaynum (#2952) Eg in the case of sockets: - X0 - X99 - X100 X99 would be picked instead of X100. --- diff --git a/testcases/lib/StartXServer.pm b/testcases/lib/StartXServer.pm index 9d4e40c7..49976394 100644 --- a/testcases/lib/StartXServer.pm +++ b/testcases/lib/StartXServer.pm @@ -87,7 +87,7 @@ sub start_xserver { # First get the last used display number, then increment it by one. # Effectively falls back to 1 if no X server is running. - my ($displaynum) = map { /(\d+)$/ } reverse sort glob($x_socketpath . '*'); + my ($displaynum) = reverse sort { $a <=> $b } map{ /(\d+)$/ } glob($x_socketpath . '*'); $displaynum++; say "Starting $parallel Xephyr instances, starting at :$displaynum...";