From 00912add46242f05bb9a1ca032dc3da5ed3919dd Mon Sep 17 00:00:00 2001 From: Orestis Date: Fri, 15 Sep 2017 12:21:35 +0300 Subject: [PATCH] Use numeric comparison in sort for $displaynum (#2952) Eg in the case of sockets: - X0 - X99 - X100 X99 would be picked instead of X100. --- testcases/lib/StartXServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..."; -- 2.39.5