diff --git a/exec/load/fidocfg.js b/exec/load/fidocfg.js index 5a97e32a1da22e8092a9981be089b889ed4c8977..ecba2b944c3585999744beda62e7d890f3984b9d 100644 --- a/exec/load/fidocfg.js +++ b/exec/load/fidocfg.js @@ -210,6 +210,9 @@ function FREQITCfg() { var f=new File(system.ctrl_dir+'freqit.ini'); var val; + var i; + var key; + var sects; if (!f.open('r')) { log(LOG_ERROR, "Unable to open '"+f.name+"'"); @@ -226,15 +229,15 @@ function FREQITCfg() if (val != undefined) this.securedirs = val.toLowerCase().split(/,/); this.maxfiles=f.iniGetValue(null, 'MaxFiles', 10); - f.iniGetSections().forEach(function(key) { + sects = f.iniGetSections(); + for (i=0; i<sects.length; i++) { + key = sects[i]; var dir = f.iniGetValue(key, 'Dir'); if (dir == undefined) { log(LOG_ERROR, "Magic value '"+key+"' without a dir configured"); return; } - if (this.magic === undefined) - this.magic = {}; this.magic[key] = {}; this.magic[key].dir=dir; this.magic[key].match=f.iniGetValue(key, 'Match', '*'); @@ -252,6 +255,6 @@ function FREQITCfg() } this.magic[key].secure = false; } - }); + } f.close(); }