Bug 797959 - "Exception" when value greater than one million with...

commas and periods is pasted to register.

Due to a use-after-free, but the underlying idea to remove the commas
from input to avoid a error dialog because of bad grouping was misguided
so revert to having the error dialog.
This commit is contained in:
John Ralls 2020-10-13 13:17:30 -07:00
parent cca3be7c81
commit c8b725d48a
2 changed files with 1 additions and 18 deletions

View File

@ -279,7 +279,7 @@ string(REGEX MATCH "^[0-9]+[.]" SWIG_MAJOR ${SWIG_VERSION})
# guile library and include dir # guile library and include dir
pkg_check_modules (GUILE3 guile-3.0 QUIET) pkg_check_modules (GUILE3 guile-3.0 QUIET)
pkg_check_modules (GUILE22 guile-2.2 QUIET) pkg_check_modules (GUILE22 guile-2.2)
pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET) pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET)
if (GUILE3_FOUND) # found guile-3.0 if (GUILE3_FOUND) # found guile-3.0

View File

@ -107,23 +107,6 @@ gnc_price_cell_modify_verify (BasicCell *_cell,
return; return;
} }
// gnc_basic_cell_set_value_internal doesn't like misplaced thousands separators
// that can result from deletes, so remove them.
for (const char *c = g_utf8_strchr (new_newval, -1, thousands_sep); c;
c = g_utf8_strchr (c, -1, thousands_sep))
{
long len = g_utf8_strlen (new_newval, -1);
long pos = g_utf8_pointer_to_offset (new_newval, c);
char *start = g_utf8_substring (new_newval, 0, pos);
char *end = g_utf8_substring (new_newval, ++pos, len);
g_free (new_newval);
if (cursor_position && *cursor_position >= pos)
--*cursor_position;
new_newval = g_strdup_printf ("%s%s", start, end);
g_free (start);
g_free (end);
}
gnc_basic_cell_set_value_internal (_cell, new_newval); gnc_basic_cell_set_value_internal (_cell, new_newval);
g_free (new_newval); g_free (new_newval);
*end_selection = *start_selection = *cursor_position; *end_selection = *start_selection = *cursor_position;