On Feb 11 16:13, Jeremy Drake via Cygwin-patches wrote:
> On Tue, 11 Feb 2025, Corinna Vinschen wrote:
> 
> > On Feb 10 17:13, Jeremy Drake via Cygwin-patches wrote:
> > > make mappings linked list in order rather than reverse order.
> >
> > Why?  I'm not asking for myself, but for the commit message.
> > It may profit a lot from explaining what the change is supposed
> > to accomplish. :)
> 
> That's two good points: 1) I didn't write a proper commit message, I'll
> do that for v3.  but 2), why does the order of the list matter?

It doesn't.  Or rather, it shouldn't.  The drive letters were in order
in /cygdrive just because of the algorithm evaluating available_drives.
That's nice, but not essential.

> On my
> system, the order returned by the functions matches my "expected" order
> (my C: comes before my D:), but I don't think there's any guarantee that
> that will always be the case.  I don't think it matters other than for
> aesthetics though,

The order in /proc/self/mounts on Linux is the order in which the
drives got mounted.  You don't get them sorted unless you pipe it
through sort.  That's ok with me.

> but I don't know the motivation behind returning the
> explicit mount entries in native_sorted order.  Is there any reason why I
> might need to sort the cygdrive mount entries?  I could see that getting
> complicated.

No sorting necessary.  I'm actually really only talking about the commit
message.  It should explain what you're doing and, especially, why.

Btw.:

-               m->dospath = wcsdup (mounts);
+               if ((m->dos.path = (wchar_t *) malloc (len * sizeof (WCHAR))))  
+                 memcpy (m->dos.path, mounts, len * sizeof (WCHAR));

A short comment preceding the above change along the lines of "store
mount point list and split into dospath entries" wouldn t hurt.


Corinna

Reply via email to