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:
Christopher Lam 2020-01-15 14:58:08 +08:00
parent 3db699786f
commit c4ab772d4b

View File

@ -2239,18 +2239,6 @@ xaccAccountOrder (const Account *aa, const Account *ab)
da = priv_aa->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 */
result = g_strcmp0 (da, db);
if (result)