Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 10504:1f80e5ad3cea
mod_admin_telnet: Fix host sorting
Reversing each %P is a noop
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 15 Dec 2019 20:43:02 +0100 |
parent | 10489:fabe50ea39f2 |
child | 10505:142bdba5eea2 |
comparison
equal
deleted
inserted
replaced
10503:e25a1a9a6e7e | 10504:1f80e5ad3cea |
---|---|
963 function def_env.host:deactivate(hostname, reason) | 963 function def_env.host:deactivate(hostname, reason) |
964 return hostmanager.deactivate(hostname, reason); | 964 return hostmanager.deactivate(hostname, reason); |
965 end | 965 end |
966 | 966 |
967 local function compare_hosts(a, b) | 967 local function compare_hosts(a, b) |
968 return a:gsub("%P", string.reverse):reverse() < b:gsub("%P", string.reverse):reverse(); | 968 return a:gsub("%P+", string.reverse):reverse() < b:gsub("%P+", string.reverse):reverse(); |
969 end | 969 end |
970 | 970 |
971 function def_env.host:list() | 971 function def_env.host:list() |
972 local print = self.session.print; | 972 local print = self.session.print; |
973 local i = 0; | 973 local i = 0; |