Use numeric comparison in sort for $displaynum (#2952)

Eg in the case of sockets:
- X0
- X99
- X100

X99 would be picked instead of X100.
This commit is contained in:
Orestis 2017-09-15 12:21:35 +03:00 committed by Michael Stapelberg
parent 6411130c85
commit 00912add46
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ sub start_xserver {
# First get the last used display number, then increment it by one. # First get the last used display number, then increment it by one.
# Effectively falls back to 1 if no X server is running. # 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++; $displaynum++;
say "Starting $parallel Xephyr instances, starting at :$displaynum..."; say "Starting $parallel Xephyr instances, starting at :$displaynum...";