Skip to content

Conversation

@cmb69
Copy link
Member

@cmb69 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 Bug label May 16, 2015
@weltling
Copy link
Contributor

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
Copy link
Member 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
Copy link
Contributor

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

Cheers.

@cmb69
Copy link
Member Author

cmb69 commented May 20, 2015

Fine. 😄

@php-pulls php-pulls merged commit 99d7852 into php:master May 21, 2015
@weltling
Copy link
Contributor

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

@cmb69 cmb69 deleted the glob-win branch July 12, 2015 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants