[PATCH 1/1] Improve device tree directory sorting

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

 



On Tue, Nov 24, 2015 at 06:17:10PM -0800, Curt Brune wrote:
> Previously when sorting the device tree directory entries, if both
> device tree entries contained the '@' character then comparison was
> made based on the length of the strings.
> 
> This did not work in all cases and could result in odd orderings.
> 
> This patch modifies the comparison function for the case when both
> strings contain the '@' character.
> 
> First a lexical comparison is made between the prefix portions of the
> strings *before* the '@' character.
> 
> Next, if the prefixes are equal, the lengths of the suffixes *after*
> the '@' character are compared.  This preserves the intent of the
> original code.
> 
> Next, if the suffix lengths are equal, a lexical comparison of the
> suffixes is made.
> 
> This is still not strictly correct, as ideally the portion after the
> '@' should be compared numerically.  However, determining what base to
> use for all case is difficult.
> 
> Signed-off-by: Curt Brune <curt at cumulusnetworks.com>

Thanks, applied.



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux