[Top][All Lists]

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

Re: [bug-mailutils] folder_create() on $HOME/Mail fails with ENOENT in C

From: Joachim Nilsson
Subject: Re: [bug-mailutils] folder_create() on $HOME/Mail fails with ENOENT in CVS code.
Date: Tue, 13 Jul 2004 15:07:45 +0200

On Tue, 2004-07-13 at 13:13, Sergey Poznyakoff wrote:
> Joachim Nilsson <address@hidden> wrote:
> > > But it effectively disables is_dir method for MH and maildir formats...
> > Sorry, I don't follow, what do you mean?  Does the method in
> > mailbox/mbox/folder.c:_path_is_scheme() run for the MH and maildir
> > formats as well?
> There is a feature called 'mailbox format autodetection': if a mailbox
> is specified by an absolute file name (as opposed to giving a fully
> qualified URL) mailutils tries to detect the format of the mailbox
> in question. In order to do so, the library tries each registered
> format in turn and calls its `is_scheme' method until one of these
> returns true or the list of formats is exhausted. With your patch applied,
> autodetection will always end up on 'mbox:' handlers, no matter what
> the actual mailbox format is.

Aha, now I understand, thanks.

If I look at the problem from my point of view (rather egotistically)
then I see at least two quick workarounds:

1. In mailbox/folder.c:folder_create(), there could be an explicit 
   last check if (!found && IS_DIR...) after the iterator loop before
   we bail out.  That if() would setup f_init() and u_init() as ptrs
   to the path_record functions.

2. In mailbox/folder.c:folder_create(), when calling the function 
   registrar_get_list() that function always returns a sorted list
   with the path_record always being the last record.

Option (2) could be implemented in (at least) two ways: either the
registrar_get_list() function always sorts the list before returning
or registar_record() prepends all records but the path_record which
it appends.

Personally I prefer option (2) with the fix only being made to the
registrar_record() function.  I've attached a new patch implementing
this rather clumsily.


Joachim Nilsson :: <joachim AT vmlinux DOT org> 
+46(0)21-123348 :: <http://vmlinux.org/joachim/>

Attachment: patch-path_record_detection.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]