Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7918F200BFF for ; Tue, 17 Jan 2017 22:13:20 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7872A160B46; Tue, 17 Jan 2017 21:13:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BD1D8160B30 for ; Tue, 17 Jan 2017 22:13:19 +0100 (CET) Received: (qmail 71382 invoked by uid 500); 17 Jan 2017 21:13:18 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 71373 invoked by uid 99); 17 Jan 2017 21:13:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2017 21:13:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A3D9FDFADC; Tue, 17 Jan 2017 21:13:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kihwal@apache.org To: common-commits@hadoop.apache.org Message-Id: <668278022b8041e4a56c9f085f3150af@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HADOOP-13976. Path globbing does not match newlines. Contributed by Eric Badger. Date: Tue, 17 Jan 2017 21:13:18 +0000 (UTC) archived-at: Tue, 17 Jan 2017 21:13:20 -0000 Repository: hadoop Updated Branches: refs/heads/branch-2 eae5bde00 -> 3017069a7 HADOOP-13976. Path globbing does not match newlines. Contributed by Eric Badger. (cherry picked from commit 706d630eb9db9658083d57d1d99b6a0f11cc5657) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3017069a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3017069a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3017069a Branch: refs/heads/branch-2 Commit: 3017069a761dfa624670849b83ce752f5270adc3 Parents: eae5bde Author: Kihwal Lee Authored: Tue Jan 17 15:12:50 2017 -0600 Committer: Kihwal Lee Committed: Tue Jan 17 15:12:50 2017 -0600 ---------------------------------------------------------------------- .../src/main/java/org/apache/hadoop/fs/GlobPattern.java | 2 +- .../src/test/java/org/apache/hadoop/fs/TestGlobPattern.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/3017069a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java index 4be5b1c..c214609 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java @@ -153,7 +153,7 @@ public class GlobPattern { if (curlyOpen > 0) { error("Unclosed group", glob, len); } - compiled = Pattern.compile(regex.toString()); + compiled = Pattern.compile(regex.toString(), Pattern.DOTALL); } /** http://git-wip-us.apache.org/repos/asf/hadoop/blob/3017069a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java index 0fffc47..128ac23 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java @@ -50,11 +50,11 @@ public class TestGlobPattern { } @Test public void testValidPatterns() { - assertMatch(true, "*", "^$", "foo", "bar"); + assertMatch(true, "*", "^$", "foo", "bar", "\n"); assertMatch(true, "?", "?", "^", "[", "]", "$"); - assertMatch(true, "foo*", "foo", "food", "fool"); - assertMatch(true, "f*d", "fud", "food"); - assertMatch(true, "*d", "good", "bad"); + assertMatch(true, "foo*", "foo", "food", "fool", "foo\n", "foo\nbar"); + assertMatch(true, "f*d", "fud", "food", "foo\nd"); + assertMatch(true, "*d", "good", "bad", "\nd"); assertMatch(true, "\\*\\?\\[\\{\\\\", "*?[{\\"); assertMatch(true, "[]^-]", "]", "-", "^"); assertMatch(true, "]", "]"); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org