Re: [PATCH] git-mailsplit: with maildirs try to process new/ if cur/ is empty
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Nov 6, 2007, 07:28 UTC
- Message-ID
- <20071106072831.GA3021@steel.home>
- In-Reply-To
- <635FFEC2-2489-443B-8425-DF2B58BE23C2@mac.com>
Michael Cohen, Tue, Nov 06, 2007 02:41:56 +0100:
Show 13 quoted lines
> On Nov 5, 2007, at 5:52 PM, Alex Riesen wrote:
>
>> Gerrit Pape, Mon, Nov 05, 2007 13:49:20 +0100:
>>> + for (i = 0; i < 2; ++i) {
>>> + snprintf(name, sizeof(name), "%s/%s", path, sub[i]);
>>> + if ((dir = opendir(name)) == NULL) {
>>> + error("cannot opendir %s (%s)", name, strerror(errno));
>>> + return -1;
>>> + }
>>
>> Why is missing "cur" (or "new", for that matter) a fatal error?
>> Why is it error at all? How about just ignoring the fact?
> In Maildir format, cur and new hold the mails. :PSo? Why *STOP* reading the mails if just one of the directories could not be opened? IOW, I suggest:
+ for (i = 0; i < 2; ++i) { + snprintf(name, sizeof(name), "%s/%s", path, sub[i]); + dir = opendir(name); + if (!dir) + continue;