Bug 134490 - Input number scanner silently accepts and skips repeated '-' and '/' characters before a number
Summary: Input number scanner silently accepts and skips repeated '-' and '/' characte...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.1.0 target:7.0.0.2 target:6....
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-07-03 22:46 UTC by Eike Rathke
Modified: 2021-05-10 22:40 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Rathke 2020-07-03 22:46:07 UTC
The number scanner used for field inputs, Calc cell input and various locale dependent numeric or date+time inputs, has an odd behaviour in that it accepts and skips '-' and '/' characters that immediately precede a number (without ignoring a leading plus or minus sign or any other meaningful string like month name though). This leads to the wrong acceptance of

--1 => -1
---1 => -1
+-1 => 1
+--1 => 1

which all should be text strings instead and not numbers.

A fallout from

    commit b00fc9462d26083b6d09f72ea44abb1e11546b63
    CommitDate: Wed Sep 15 11:54:10 2010 +0200

        sc-date-fix.diff: Parse 'june-2007' as June 1 2007 in en-US locales

that implemented the intention wrongly.
Comment 1 Commit Notification 2020-07-06 06:57:14 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/348e78b8ccd04b59140c7f83504c7823b2ffbe8c

Resolves: tdf#134490 do not skip all trailing '-' or '/' of the start string

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2020-07-06 08:55:45 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/3295cc04dcba336b2ad8989482fb60c0c4c091d6

Resolves: tdf#134490 do not skip all trailing '-' or '/' of the start string

It will be available in 7.0.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2020-07-06 09:49:54 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/7151c6d8effa405148533381102656d95b7a0546

Resolves: tdf#134490 do not skip all trailing '-' or '/' of the start string

It will be available in 6.4.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 b. 2020-07-10 19:48:12 UTC
hello @Eike, 

looks better now, 

thanks for fixing this issue :-)

btw ... 
'---1 => -1' and 
'+--1 => 1' 
wouldn't have bothered me much
Comment 6 Commit Notification 2021-05-10 22:40:41 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d7db1f688fc3b7e7ce9276776a40d6d8db8d536

tdf#134490: sc_ucalc: Add unittest

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.