Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve converting strings to ints/longs #3579

Closed
wants to merge 3 commits into from
Closed

improve converting strings to ints/longs #3579

wants to merge 3 commits into from

Conversation

krader1961
Copy link
Contributor

The existing code is inconsistent, and in a couple of cases wrong, about
dealing with strings that are not valid ints. For example, there are
locations that call wcstol() and check errno without first setting errno
to zero. Normalize the code to a consistent pattern.

This does make some syntax more liberal. For example echo $PATH[1 .. 3]
is now valid due to uniformly allowing leading and trailing whitespace
around numbers. Whereas prior to this change you would get a "Invalid
index value" error. Contrast this with echo $PATH[ 1.. 3 ] which was
valid and still is.

Kurtis Rader added 3 commits November 23, 2016 20:21
The existing code is inconsistent, and in a couple of cases wrong, about
dealing with strings that are not valid ints. For example, there are
locations that call wcstol() and check errno without first setting errno
to zero. Normalize the code to a consistent pattern.

This does make some syntax more liberal. For example `echo $PATH[1 .. 3]`
is now valid due to uniformly allowing leading and trailing whitespace
around numbers. Whereas prior to this change you would get a "Invalid
index value" error. Contrast this with `echo $PATH[ 1.. 3 ]` which was
valid and still is.
@krader1961
Copy link
Contributor Author

Squash merged as commit a928517.

@krader1961 krader1961 closed this Nov 26, 2016
@faho faho added enhancement release notes Something that is or should be mentioned in the release notes labels Dec 2, 2016
@zanchey zanchey added this to the fish 2.5.0 milestone Dec 3, 2016
@krader1961 krader1961 deleted the wcstoi branch December 9, 2016 04:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement release notes Something that is or should be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants