Comparison

plugins/mod_admin_telnet.lua @ 10505:142bdba5eea2

mod_admin_telnet: Sort by complete labels Might as well.
author Kim Alvefur <zash@zash.se>
date Sun, 15 Dec 2019 20:44:10 +0100
parent 10504:1f80e5ad3cea
child 10506:af214e2739f5
comparison
equal deleted inserted replaced
10504:1f80e5ad3cea 10505:142bdba5eea2
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("[^.]+", string.reverse):reverse() < b:gsub("[^.]+", 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;