[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Multi-level Local Newsgroups Name Bugs



Matthias Andree <ma@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:

> Matthias Andree <ma@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
>
>> I will take most of them into my "ma" tree and torture them.
>
> It did not quite work. Article counting here now does:
>
> 	if (chdirgroup(g->name, FALSE)) {
> 	    if (g->count == 0) {
> 		g->count = (g->last >= g->first ? g->last - g->first + 1 : 0);
> 		/* FIXME: count articles in group */
> 		i = 0;
> 		if ((d = opendir("."))) {
> 		    while ((de = readdir(d))) {
> 			if (check_allnum(de->d_name))
> 			    i++;
> 		    }
> 		    g->count = i;
> 		    closedir(d);
> 		}
> 	    }

Still counts all filenames. Stop the readdir() loop when i>=g->count.

> where check_allnum does:
>
> int check_allnum(const char *x)
> {
>     while (*x) {
> 	if (!strchr("0123456789", *x))
> 	    return 0;
> 	x++;
>     }
>     return 1;
> }
>
> That works for the x vs. x.y case.

You know about alt.2600, alt.2600.hackerz?

Stefan


-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list