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

Conversation

@krader1961
Copy link
Contributor

krader1961 commented Nov 24, 2016

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 Nov 23, 2016
Kurtis Rader
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
@krader1961
Copy link
Contributor Author

krader1961 commented Nov 26, 2016

Squash merged as commit a928517.

@krader1961 krader1961 closed this Nov 26, 2016
@zanchey zanchey added this to the fish 2.5.0 milestone Dec 3, 2016
@krader1961 krader1961 deleted the krader1961:wcstoi branch Dec 9, 2016
@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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.