diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-08-09 11:31:37 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-08-09 11:31:37 -0700 |
| commit | 553101e8b5a988003f594037dda82301b0967625 (patch) | |
| tree | 8fccc387144b19810bc26d5395666ebace4adbb0 /rule-compiler | |
| parent | 3cd0ab1b3bacd5596d7fec989b2cd9cb413f4314 (diff) | |
| parent | e01c0adff28602d48ad6f0d618bee072ec7843da (diff) | |
| download | infinitytier-553101e8b5a988003f594037dda82301b0967625.tar.gz infinitytier-553101e8b5a988003f594037dda82301b0967625.zip | |
merge dev
Diffstat (limited to 'rule-compiler')
| -rw-r--r-- | rule-compiler/rule-compiler.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rule-compiler/rule-compiler.js b/rule-compiler/rule-compiler.js index 38134b74..6e21c2dc 100644 --- a/rule-compiler/rule-compiler.js +++ b/rule-compiler/rule-compiler.js @@ -229,12 +229,16 @@ function _cleanMac(m) { m = m.toLowerCase(); var m2 = ''; + let charcount = 0; for(let i=0;((i<m.length)&&(m2.length<17));++i) { let c = m.charAt(i); if ("0123456789abcdef".indexOf(c) >= 0) { m2 += c; - if ((m2.length > 0)&&(m2.length !== 17)&&((m2.length & 1) === 0)) + charcount++; + if ((m2.length > 0)&&(m2.length !== 17)&&(charcount >= 2) ) { m2 += ':'; + charcount=0; + } } } return m2; |
