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

fix #69628: complex GLOB_BRACE fails on Windows #1278

Merged
merged 4 commits into from May 21, 2015

Conversation

4 participants
@cmb69
Copy link
Contributor

cmb69 commented May 13, 2015

The problem is that pl is advanced to pm after an opening bracket has been encountered, so the characters before the last opening bracket are ignored. This might be a deliberate design decision (allow only one bracketed expression inside a braced alternative), but it looks more like a bug. Furthermore multiple bracketed expressions inside a braced alternative seem to be supported by *nix implementations.

The suggested patch solves this by using another temporary variable (pb) to mark the position of the most recent left bracket.

With regard to bug69628.phpt: I copied sort_var_dump() from glob_basic.phpt and used it, even though sorting should happen automatically unless GLOB_NOSORT is used.

@smalyshev smalyshev added the Bugfix label May 16, 2015

@weltling

This comment has been minimized.

Copy link
Contributor

weltling commented May 20, 2015

I've tested your branch and it looks fine. I'll merge it next days if there are no other comments. One thing you probably should add to the test is a skipif for the case there's no GLOB_BRACE.

Thanks.

@cmb69

This comment has been minimized.

Copy link
Contributor Author

cmb69 commented May 20, 2015

Good point; I've added the SKIPIF. I've noticed that a respective SKIPIF is missing for glob_variation.phpt – shall I make a separate PR and file a bug report?

@weltling

This comment has been minimized.

Copy link
Contributor

weltling commented May 20, 2015

Ah, good catch. I'd say a new PR isn't necessary, that test is still about the same topic.

Cheers.

@cmb69

This comment has been minimized.

Copy link
Contributor Author

cmb69 commented May 20, 2015

Fine. 😄

@php-pulls php-pulls merged commit 99d7852 into php:master May 21, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@weltling

This comment has been minimized.

Copy link
Contributor

weltling commented May 21, 2015

Merged and pushed into 5.5+ as well. Thanks for your work!

@cmb69 cmb69 deleted the cmb69:glob-win branch Jul 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.