From c4ab772d4b3f6006c576010815799821602e4d9a Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Wed, 15 Jan 2020 14:58:08 +0800 Subject: [PATCH] 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 --- libgnucash/engine/Account.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp index fcacf18623..194976dbd6 100644 --- a/libgnucash/engine/Account.cpp +++ b/libgnucash/engine/Account.cpp @@ -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)