Re: [PATCH] Teach mailsplit about Maildir's

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

 



"Fernando J. Pereda" <ferdy@xxxxxxxxxx> writes:

> +int split_maildir(const char *maildir, const char *dir, int nr_prec, int skip)
>  {
> ...
> +	while ((maildent = readdir(mddir)) != NULL) {
> +		FILE *f;
> +
> +		snprintf(file, sizeof(file), "%s/%s",
> +				curdir, maildent->d_name);
> +
> +		if (maildent->d_name[0] == '.')
> +			continue;
>  ...
> +		sprintf(name, "%s/%0*d", dir, nr_prec, ++skip);
> +		split_one(f, name, 1);
> +
> +		fclose(f);
> +	}
> +
> +	closedir(mddir);
> +
> +	ret = skip;
> +out:
> +	return ret;
> +}

I do not personally deal with maildir so I do not know for sure,
but this feels very wrong.

What order are you emitting the output?

split_mbox() is designed to number the messages the same order
as they are found in the mailbox, but the above loop relies on
readdir() to give them in a reasonable order to you, which does
not seem a right assumption to me (otherwise "/bin/ls" and
friends would not sort what they read from the filesystem would
they?).

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]