mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Unit tests and bug fixes for removable drive finders.
This commit is contained in:
@@ -10,8 +10,9 @@ class LinuxRemovableDriveFinder extends UnixRemovableDriveFinder {
|
||||
@Override
|
||||
protected String parseMountPoint(String line) {
|
||||
// The format is "/dev/foo on /bar/baz type bam (opt1,opt2)"
|
||||
line = line.replaceFirst("^/dev/[^ ]+ on ", "");
|
||||
return line.replaceFirst(" type [^ ]+ \\([^)]+\\)$", "");
|
||||
String pattern = "^/dev/[^ ]+ on (.*) type [^ ]+ \\([^)]+\\)$";
|
||||
String path = line.replaceFirst(pattern, "$1");
|
||||
return path.equals(line) ? null : path;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,8 +10,9 @@ class MacRemovableDriveFinder extends UnixRemovableDriveFinder {
|
||||
@Override
|
||||
protected String parseMountPoint(String line) {
|
||||
// The format is "/dev/foo on /bar/baz (opt1, opt2)"
|
||||
line = line.replaceFirst("^/dev/[^ ]+ on ", "");
|
||||
return line.replaceFirst(" \\([^)]+\\)$", "");
|
||||
String pattern = "^/dev/[^ ]+ on (.*) \\([^)]+\\)$";
|
||||
String path = line.replaceFirst(pattern, "$1");
|
||||
return path.equals(line) ? null : path;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user