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
base: master
from

Conversation

Projects
None yet
3 participants
@krader1961
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.

krader1961 added some commits Nov 23, 2016

improve converting strings to ints/longs
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

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Nov 26, 2016

Contributor

Squash merged as commit a928517.

Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment