diff --git a/src/function.c b/src/function.c index d1e09db..df48178 100644 --- a/src/function.c +++ b/src/function.c @@ -196,16 +196,11 @@ void purge_strplist(Strp *sp) { Strp *nxt; - debug("do...\n"); while(sp) { - debug("nxt =...\n"); nxt = sp->next; - debug("free...\n"); Free((char**)&sp); - debug("sp = nx\n"); sp = nxt; - debug("while..\n"); } } diff --git a/src/urlcap.c b/src/urlcap.c index d0bb823..4f560e2 100644 --- a/src/urlcap.c +++ b/src/urlcap.c @@ -46,23 +46,19 @@ void urlcapture(const char *rest) send_spy(SPYSTR_URL,"%s",url); - if ((n = urlhistmax)) - { - debug("prepend\n"); - prepend_strp(&urlhistory,url); + if ((n = urlhistmax) < 0) + return; - debug("for...\n"); - for(sp=urlhistory;sp;sp=sp->next) + prepend_strp(&urlhistory,url); + + for(sp=urlhistory;sp;sp=sp->next) + { + if (n <= 0) { - if (n <= 0) - { - debug("purge...\n"); - purge_strplist(sp->next); - debug("return\n"); - return; - } - n--; + purge_strplist(sp->next); + return; } + n--; } }