summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmodules/abbrgen/abbreviation_gen_Darwinbin30896 -> 26480 bytes
-rwxr-xr-xmodules/abbrgen/abbreviation_gen_Linuxbin19364 -> 19392 bytes
-rw-r--r--modules/abbrgen/abbrgen.js5
3 files changed, 3 insertions, 2 deletions
diff --git a/modules/abbrgen/abbreviation_gen_Darwin b/modules/abbrgen/abbreviation_gen_Darwin
index 7fd9596..0781901 100755
--- a/modules/abbrgen/abbreviation_gen_Darwin
+++ b/modules/abbrgen/abbreviation_gen_Darwin
Binary files differ
diff --git a/modules/abbrgen/abbreviation_gen_Linux b/modules/abbrgen/abbreviation_gen_Linux
index dd151e7..fb08831 100755
--- a/modules/abbrgen/abbreviation_gen_Linux
+++ b/modules/abbrgen/abbreviation_gen_Linux
Binary files differ
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"));
});
});