Fix skdiff when using windows path that begins with a drive letter
Review URL: https://mail.google.com/mail/u/0/?shva=1#inbox/138d92244ca33549 git-svn-id: http://skia.googlecode.com/svn/trunk@4838 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
80a4a60f96
commit
f1478f8803
@ -1047,13 +1047,22 @@ static void print_diff_page (const int matchCount,
|
||||
|
||||
// Need to convert paths from relative-to-cwd to relative-to-outputDir
|
||||
// FIXME this doesn't work if there are '..' inside the outputDir
|
||||
unsigned int ui;
|
||||
|
||||
bool pathFromRoot;
|
||||
#ifdef SK_BUILD_FOR_WIN32
|
||||
pathFromRoot = outputDir.size() > 1 && ':' == outputDir[1];
|
||||
#else
|
||||
pathFromRoot = outputDir.size() > 0 && PATH_DIV_CHAR == outputDir[0];
|
||||
#endif
|
||||
SkString relativePath;
|
||||
if (!pathFromRoot) {
|
||||
unsigned int ui;
|
||||
for (ui = 0; ui < outputDir.size(); ui++) {
|
||||
if (outputDir[ui] == PATH_DIV_CHAR) {
|
||||
relativePath.append(".." PATH_DIV_STR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outputStream.writeText("<html>\n<body>\n");
|
||||
print_table_header(&outputStream, matchCount, colorThreshold, differences,
|
||||
|
Loading…
Reference in New Issue
Block a user