From 5538f2e0324be41577568029030d097a8a468e6e Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 4 Feb 2013 02:36:36 +0100 Subject: [PATCH] big-todo.103 --- qmail-clean.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'qmail-clean.c') diff --git a/qmail-clean.c b/qmail-clean.c index 7539007..4926f86 100644 --- a/qmail-clean.c +++ b/qmail-clean.c @@ -73,22 +73,26 @@ void main() if (line.len < 7) { respond("x"); continue; } if (line.len > 100) { respond("x"); continue; } if (line.s[line.len - 1]) { respond("x"); continue; } /* impossible */ - for (i = 5;i < line.len - 1;++i) + for (i = line.len - 2;i > 4;--i) + { + if (line.s[i] == '/') break; if ((unsigned char) (line.s[i] - '0') > 9) { respond("x"); continue; } - if (!scan_ulong(line.s + 5,&id)) { respond("x"); continue; } + } + if (line.s[i] == '/') + if (!scan_ulong(line.s + i + 1,&id)) { respond("x"); continue; } if (byte_equal(line.s,5,"foop/")) { #define U(prefix,flag) fmtqfn(fnbuf,prefix,id,flag); \ if (unlink(fnbuf) == -1) if (errno != error_noent) { respond("!"); continue; } - U("intd/",0) + U("intd/",1) U("mess/",1) respond("+"); } else if (byte_equal(line.s,4,"todo/")) { - U("intd/",0) - U("todo/",0) + U("intd/",1) + U("todo/",1) respond("+"); } else -- cgit v1.2.3