fix (str2num) : handle leading '+' sign in to_num parsers#1198
Open
jalvesz wants to merge 1 commit into
Open
Conversation
…12) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1198 +/- ##
==========================================
+ Coverage 68.60% 68.62% +0.01%
==========================================
Files 409 409
Lines 13784 13784
Branches 1559 1559
==========================================
+ Hits 9457 9459 +2
+ Misses 4327 4325 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #1197 by CoPilot:
to_num()silently returned 0 for any numeric string with a leading + (e.g. "+1", "+1.234"). The integer and all four real parsers (to_sp_base, to_dp_base, to_xdp_base, to_qp_base) only consumed a leading -; a + was left unadvanced, the digit loop found a non-digit immediately, and the parser succeeded with value 0.Changes: