From 43315f32e7f980a774b85ec6556fcfbb8c3507db Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 13 May 2015 22:37:33 +0200 Subject: [PATCH 1/4] added PHPT to check for bug #69628 --- ext/standard/tests/file/bug69628.phpt | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 ext/standard/tests/file/bug69628.phpt diff --git a/ext/standard/tests/file/bug69628.phpt b/ext/standard/tests/file/bug69628.phpt new file mode 100644 index 00000000000..e791122137f --- /dev/null +++ b/ext/standard/tests/file/bug69628.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #69628: GLOB_BRACE with multiple brackets within the braces fails +--FILE-- + +--CLEAN-- + +--EXPECTF-- +array(2) { + [0]=> + string(%d) "%s/bug69628/image.gIf" + [1]=> + string(%d) "%s/bug69628/image.jPg" +} From e42aae1e9bf5e15d8114c8ae4b5e99cc6e555d9b Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 13 May 2015 23:47:54 +0200 Subject: [PATCH 2/4] fix #69628: complex GLOB_BRACE fails on Windows --- win32/glob.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win32/glob.c b/win32/glob.c index 43884509ce9..1541fcf9666 100644 --- a/win32/glob.c +++ b/win32/glob.c @@ -293,17 +293,19 @@ globexp2(ptr, pattern, pglob, rv) } for (i = 0, pl = pm = ptr; pm <= pe; pm++) { + const Char *pb; + switch (*pm) { case LBRACKET: /* Ignore everything between [] */ - for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++) + for (pb = pm++; *pm != RBRACKET && *pm != EOS; pm++) ; if (*pm == EOS) { /* * We could not find a matching RBRACKET. * Ignore and just look for RBRACE */ - pm = pl; + pm = pb; } break; From b654aa460690fb3420010e8d28774d6544c76eff Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 20 May 2015 18:39:07 +0200 Subject: [PATCH 3/4] added SKIPIF section to test to make sure that GLOB_BRACE is supported --- ext/standard/tests/file/bug69628.phpt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/standard/tests/file/bug69628.phpt b/ext/standard/tests/file/bug69628.phpt index e791122137f..7e18619a3ef 100644 --- a/ext/standard/tests/file/bug69628.phpt +++ b/ext/standard/tests/file/bug69628.phpt @@ -1,5 +1,11 @@ --TEST-- Bug #69628: GLOB_BRACE with multiple brackets within the braces fails +--SKIPIF-- + --FILE-- Date: Wed, 20 May 2015 20:23:21 +0200 Subject: [PATCH 4/4] added missing GLOB_BRACE support check --- ext/standard/tests/file/glob_variation.phpt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/standard/tests/file/glob_variation.phpt b/ext/standard/tests/file/glob_variation.phpt index 00fd6ff3ed4..9d3b8793794 100644 --- a/ext/standard/tests/file/glob_variation.phpt +++ b/ext/standard/tests/file/glob_variation.phpt @@ -5,6 +5,9 @@ Test glob() function: usage variations if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } +if (!defined('GLOB_BRACE')) { + die('skip this test requires GLOB_BRACE support'); +} ?> --FILE--