shithub: neatroff

Download patch

ref: ca4bbd28c33899685d9d7362bc90e0545dc118d6
parent: 46a592f595b3b0cc68a2ae387098ee5fc29194ba
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Dec 12 11:31:26 EST 2014

tr: evaluate integer arguments for most requests

--- a/tr.c
+++ b/tr.c
@@ -450,30 +450,30 @@
 
 static void tr_hy(char **args)
 {
-	n_hy = args[1] ? atoi(args[1]) : 1;
+	n_hy = args[1] ? eval_re(args[1], n_hy, '\0') : 1;
 }
 
 static void tr_hycost(char **args)
 {
-	n_hycost = args[1] ? atoi(args[1]) : 0;
+	n_hycost = args[1] ? eval_re(args[1], n_hycost, '\0') : 0;
 }
 
 static void tr_pmll(char **args)
 {
-	n_pmll = args[1] ? atoi(args[1]) : 0;
-	n_pmllcost = args[2] ? atoi(args[2]) : 100;
+	n_pmll = args[1] ? eval_re(args[1], n_pmll, '\0') : 0;
+	n_pmllcost = args[2] ? eval_re(args[2], n_pmllcost, '\0') : 100;
 }
 
 static void tr_lg(char **args)
 {
 	if (args[1])
-		n_lg = atoi(args[1]);
+		n_lg = eval(args[1], '\0');
 }
 
 static void tr_kn(char **args)
 {
 	if (args[1])
-		n_kn = atoi(args[1]);
+		n_kn = eval(args[1], '\0');
 }
 
 static void tr_cp(char **args)