diff options
Diffstat (limited to 'modules/abbrgen')
-rwxr-xr-x | modules/abbrgen/abbreviation_gen_Darwin | bin | 30896 -> 26480 bytes | |||
-rwxr-xr-x | modules/abbrgen/abbreviation_gen_Linux | bin | 19364 -> 19392 bytes | |||
-rw-r--r-- | modules/abbrgen/abbrgen.js | 5 |
3 files changed, 3 insertions, 2 deletions
diff --git a/modules/abbrgen/abbreviation_gen_Darwin b/modules/abbrgen/abbreviation_gen_Darwin Binary files differindex 7fd9596..0781901 100755 --- a/modules/abbrgen/abbreviation_gen_Darwin +++ b/modules/abbrgen/abbreviation_gen_Darwin diff --git a/modules/abbrgen/abbreviation_gen_Linux b/modules/abbrgen/abbreviation_gen_Linux Binary files differindex dd151e7..fb08831 100755 --- a/modules/abbrgen/abbreviation_gen_Linux +++ b/modules/abbrgen/abbreviation_gen_Linux diff --git a/modules/abbrgen/abbrgen.js b/modules/abbrgen/abbrgen.js index 64a29b1..ba6248b 100644 --- a/modules/abbrgen/abbrgen.js +++ b/modules/abbrgen/abbrgen.js @@ -13,6 +13,7 @@ function get_abbreviations(abbr,num,cb){ console.log(err.toString()); console.log(err.stack); cb([]); + return; } cb(stdout.split("\n")); }); @@ -38,11 +39,11 @@ module.exports=function(app,io,_moddir){ res.send("ERROR: Number of abbreviations too large."); return; } - if(!abbr.match(/^[a-z]+$/i)||isNaN(+num)){ + if(!abbr.match(/^[a-z]+$/i)||isNaN(+num)||num<0||num%1!=0){ res.send("ERROR: Invalid input values."); return; } - get_abbreviations(abbr,num,function(answers){ + get_abbreviations(abbr,num|0,function(answers){ res.send(answers.join("\n")); }); }); |