mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 797576 - xaccAccountOrder shouldn't sort account codes as base-36
Thanks to yegor for discovering it is unreliable for sorting. It has
been present since 50646f04
This commit is contained in:
parent
3db699786f
commit
c4ab772d4b
@ -2239,18 +2239,6 @@ xaccAccountOrder (const Account *aa, const Account *ab)
|
|||||||
da = priv_aa->accountCode;
|
da = priv_aa->accountCode;
|
||||||
db = priv_ab->accountCode;
|
db = priv_ab->accountCode;
|
||||||
|
|
||||||
/* If accountCodes are both base 36 integers do an integer sort */
|
|
||||||
la = strtoul (da, &endptr, 36);
|
|
||||||
if ((*da != '\0') && (*endptr == '\0'))
|
|
||||||
{
|
|
||||||
lb = strtoul (db, &endptr, 36);
|
|
||||||
if ((*db != '\0') && (*endptr == '\0'))
|
|
||||||
{
|
|
||||||
if (la < lb) return -1;
|
|
||||||
if (la > lb) return +1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Otherwise do a string sort */
|
/* Otherwise do a string sort */
|
||||||
result = g_strcmp0 (da, db);
|
result = g_strcmp0 (da, db);
|
||||||
if (result)
|
if (result)
|
||||||
|
Loading…
Reference in New Issue
Block a user