Repository: karaf Updated Branches: refs/heads/master a8049e01f -> 858920dd0
Fix exception in grep with colored output Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/b6e09858 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/b6e09858 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/b6e09858 Branch: refs/heads/master Commit: b6e09858a96c7fc384bf10b9dc7b05db7add5f30 Parents: a8049e0 Author: Guillaume Nodet <[email protected]> Authored: Wed Sep 21 10:34:06 2016 +0200 Committer: Guillaume Nodet <[email protected]> Committed: Wed Sep 21 10:34:06 2016 +0200 ---------------------------------------------------------------------- .../main/java/org/apache/karaf/shell/commands/impl/GrepAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/b6e09858/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/GrepAction.java ---------------------------------------------------------------------- diff --git a/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/GrepAction.java b/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/GrepAction.java index d15d4e9..6dcb054 100644 --- a/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/GrepAction.java +++ b/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/GrepAction.java @@ -175,9 +175,9 @@ public class GrepAction implements Action { sbl.append(String.format("%6d ", lineno)); } sbl.style(AttributedStyle.DEFAULT); - Matcher matcher2 = p2.matcher(line); AttributedString aLine = AttributedString.fromAnsi(line); AttributedStyle style; + Matcher matcher2 = p2.matcher(aLine.toString()); if (!invertMatch && color != ColorOption.never) { style = getMatchingStyle(); } else {
