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

url: fix off-by-one error in loop handling dots #8420

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
7 participants
@lpinca
Member

lpinca commented Sep 6, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

url

Description of change

Fixes an error where a loop, used to traverse an array of length n, ran n + 1 times instead of n.

url: fix off-by-one error in loop handling dots
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.

PR-URL: #8420
@lpinca

This comment has been minimized.

Show comment
Hide comment
@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas
Member

evanlucas commented Sep 6, 2016

/cc @mscdex ?

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Sep 6, 2016

Contributor

This needs a test.

Contributor

mscdex commented Sep 6, 2016

This needs a test.

@lpinca

This comment has been minimized.

Show comment
Hide comment
@lpinca

lpinca Sep 6, 2016

Member

Hmm any suggestion? How do you test that an internal loop runs the correct amount of times. Right now it works because the first iteration is basically a noop.

Member

lpinca commented Sep 6, 2016

Hmm any suggestion? How do you test that an internal loop runs the correct amount of times. Right now it works because the first iteration is basically a noop.

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Sep 6, 2016

Contributor

I assumed that with the use of "error" in the PR description/title that you already had some kind of input that triggered an actual incorrect output? Or did you just find this by perusing the source code or ?

Contributor

mscdex commented Sep 6, 2016

I assumed that with the use of "error" in the PR description/title that you already had some kind of input that triggered an actual incorrect output? Or did you just find this by perusing the source code or ?

@lpinca

This comment has been minimized.

Show comment
Hide comment
@lpinca

lpinca Sep 6, 2016

Member

The latter. I wanted to see the algorithm behind url.resolve() and I noticed that minor "issue".
I agree, the use of "error" in the commit message is a bit misleading but in a certain sense it is still an error and I couldn't find better words to describe the change.

Member

lpinca commented Sep 6, 2016

The latter. I wanted to see the algorithm behind url.resolve() and I noticed that minor "issue".
I agree, the use of "error" in the commit message is a bit misleading but in a certain sense it is still an error and I couldn't find better words to describe the change.

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Sep 6, 2016

Contributor

Interesting, this has actually been this way since 2011 (af15b4e).

This change LGTM though.

Contributor

mscdex commented Sep 6, 2016

Interesting, this has actually been this way since 2011 (af15b4e).

This change LGTM though.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Sep 7, 2016

Member

LGTM given that CI is green-ish (other than the unfortunately expected arm failures)

Member

jasnell commented Sep 7, 2016

LGTM given that CI is green-ish (other than the unfortunately expected arm failures)

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell
Member

jasnell commented Sep 9, 2016

@thefourtheye

This comment has been minimized.

Show comment
Hide comment
@thefourtheye

thefourtheye Sep 10, 2016

Contributor

LGTM

Contributor

thefourtheye commented Sep 10, 2016

LGTM

jasnell added a commit that referenced this pull request Sep 12, 2016

url: fix off-by-one error in loop handling dots
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.

PR-URL: #8420
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Sep 12, 2016

Member

Landed in 63493e1

Member

jasnell commented Sep 12, 2016

Landed in 63493e1

@jasnell jasnell closed this Sep 12, 2016

@lpinca lpinca deleted the lpinca:fix/off-by-one-error branch Sep 12, 2016

Fishrock123 added a commit that referenced this pull request Sep 14, 2016

url: fix off-by-one error in loop handling dots
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.

PR-URL: #8420
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

MylesBorins added a commit that referenced this pull request Sep 30, 2016

url: fix off-by-one error in loop handling dots
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.

PR-URL: #8420
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

MylesBorins added a commit that referenced this pull request Oct 10, 2016

url: fix off-by-one error in loop handling dots
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.

PR-URL: #8420
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

rvagg added a commit that referenced this pull request Oct 18, 2016

url: fix off-by-one error in loop handling dots
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.

PR-URL: #8420
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

MylesBorins added a commit that referenced this pull request Oct 26, 2016

url: fix off-by-one error in loop handling dots
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.

PR-URL: #8420
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

@MylesBorins MylesBorins referenced this pull request Oct 26, 2016

Closed

V4.6.2 proposal #9298

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