static void SplitPathAndPattern(string spec, out string path, out string pattern)
{
int p = spec.LastIndexOf ('/');
if (p != -1) {
//
// Windows does not like /file.cs, switch that to:
// "\", "file.cs"
//
if (p == 0) {
path = "\\";
pattern = spec.Substring (1);
} else {
path = spec.Substring (0, p);
pattern = spec.Substring (p + 1);
}
return;
}
p = spec.LastIndexOf ('\\');
if (p != -1) {
path = spec.Substring (0, p);
pattern = spec.Substring (p + 1);
return;
}
path = ".";
pattern = spec;
}