commit a46c35a576129d7b85963e601e9a359159e4ca6d
parent 204e884a419d33e9323a0bc13ee1b1a2090f3cb6
Author: pancake <nopcode.org>
Date: Tue, 11 May 2010 01:24:10 +0200
* Honor LIMIT config var
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
@@ -8,3 +8,4 @@
#define FWDSUB "Fwd: "
#define REPSUB "Re: "
#define DEBUG 0
+#define LIMIT 50
diff --git a/dmc.c b/dmc.c
@@ -454,7 +454,9 @@ printf ("FILE IS =%s\n", file);
static int dmcpull(int num, int lim, int dir) {
int ret, count = 0;
char cmd[64];
- for (;num!=lim;num+=dir) {
+ char *slimit = cfgget ("LIMIT=");
+ int limit = slimit? atoi (slimit): LIMIT;
+ for (;num!=lim && (!limit||count<limit);num+=dir) {
snprintf (cmd, sizeof (cmd), "cat %d\n", num);
ret = dmccmd (cmd);
printf ("RETURN IS = %d\n", ret);