|
From: <cr...@us...> - 2009-05-11 12:36:14
|
Revision: 5471
http://jnode.svn.sourceforge.net/jnode/?rev=5471&view=rev
Author: crawley
Date: 2009-05-11 12:36:06 +0000 (Mon, 11 May 2009)
Log Message:
-----------
Curly brackets in path patterns need to be escaped ... until they are
implemented.
Modified Paths:
--------------
trunk/shell/src/shell/org/jnode/shell/PathnamePattern.java
trunk/shell/src/test/org/jnode/test/shell/PathnamePatternTest.java
Modified: trunk/shell/src/shell/org/jnode/shell/PathnamePattern.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/PathnamePattern.java 2009-05-09 12:11:05 UTC (rev 5470)
+++ trunk/shell/src/shell/org/jnode/shell/PathnamePattern.java 2009-05-11 12:36:06 UTC (rev 5471)
@@ -549,6 +549,8 @@
case '*':
case '?':
case '$':
+ case '{':
+ case '}':
case '^':
case '\\':
return "\\" + ch;
Modified: trunk/shell/src/test/org/jnode/test/shell/PathnamePatternTest.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/PathnamePatternTest.java 2009-05-09 12:11:05 UTC (rev 5470)
+++ trunk/shell/src/test/org/jnode/test/shell/PathnamePatternTest.java 2009-05-11 12:36:06 UTC (rev 5471)
@@ -112,6 +112,9 @@
assertEquals("PathnamePattern{source='\"/a/*\"',absolute=true,patterns=['a','^\\*$']}",
PathnamePattern.compilePathPattern("\"/a/*\"", DF).toRegexString());
+
+ assertEquals("PathnamePattern{source='{print \\$1}',absolute=false,patterns=['^\\{print \\$1\\}$']}",
+ PathnamePattern.compilePathPattern("{print \\$1}", DF).toRegexString());
}
public void testExpand() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|