Skip to content

Commit

Permalink
fix a bug for issue #122. (additional)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmi committed Jun 26, 2014
1 parent 1d26f8a commit e19e4b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/jp/vmi/selenium/selenese/utils/PathUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.File;
import java.io.FilenameFilter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.exec.OS;
Expand Down Expand Up @@ -73,7 +74,8 @@ public static File searchExecutableFile(final String filename) {
return null;
}

private static final Pattern SEP_RE = Pattern.compile("[/\\\\]");
private static final Pattern SEP_REGEX = Pattern.compile("[/\\\\]");
private static final String SEP_REPL = Matcher.quoteReplacement(File.separator);

/**
* Normalize filename separator.
Expand All @@ -84,6 +86,6 @@ public static File searchExecutableFile(final String filename) {
public static String normalizeSeparator(String filename) {
if (filename == null)
return null;
return SEP_RE.matcher(filename).replaceAll(File.separator);
return SEP_REGEX.matcher(filename).replaceAll(SEP_REPL);
}
}

0 comments on commit e19e4b3

Please sign in to comment.