Fix #115029: Ignore spaces to the left of the unit. #115159

Open
Ian Failing wants to merge 1 commits from Ian-Failing/brepoIF:bug1 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 7 additions and 1 deletions
Showing only changes of commit fbd7275726 - Show all commits

View File

@ -1954,7 +1954,13 @@ static bool unit_distribute_negatives(char *str, const int str_maxncpy)
*/
static int find_previous_non_value_char(const char *str, const int start_ofs)
{
for (int i = start_ofs; i > 0; i--) {
int spacetrim_ofs;
for (spacetrim_ofs = start_ofs; spacetrim_ofs > 0; spacetrim_ofs--) {
if (!(str[spacetrim_ofs - 1] == ' ')) {
break;
}
}
for (int i = spacetrim_ofs; i > 0; i--) {
if (ch_is_op(str[i - 1]) || strchr("( )", str[i - 1])) {
return i;
}