зеркало из https://github.com/mozilla/gecko-dev.git
fixes bug 224320 "remove bogus IsDirectory canonicalization" r=dougt
This commit is contained in:
Родитель
aab480ce19
Коммит
df6de13bdc
|
@ -1,4 +1,5 @@
|
||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/* vim:set ts=4 sw=4 et cindent: */
|
||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
|
@ -82,19 +83,17 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
|
||||||
// contains semicolons we need to manually escape them.
|
// contains semicolons we need to manually escape them.
|
||||||
escPath.ReplaceSubstring(";", "%3b");
|
escPath.ReplaceSubstring(";", "%3b");
|
||||||
|
|
||||||
// XXX this should be unnecessary
|
// if this file references a directory, then we need to ensure that the
|
||||||
if (escPath[escPath.Length() - 1] != '/') {
|
// URL ends with a slash. this is important since it affects the rules
|
||||||
|
// for relative URL resolution when this URL is used as a base URL.
|
||||||
|
// if the file does not exist, then we make no assumption about its type,
|
||||||
|
// and simply leave the URL unmodified.
|
||||||
|
if (escPath.Last() != '/') {
|
||||||
PRBool dir;
|
PRBool dir;
|
||||||
rv = aFile->IsDirectory(&dir);
|
rv = aFile->IsDirectory(&dir);
|
||||||
if (NS_FAILED(rv))
|
if (NS_SUCCEEDED(rv) && dir)
|
||||||
NS_WARNING(PromiseFlatCString(
|
|
||||||
NS_LITERAL_CSTRING("Cannot tell if ") + escPath +
|
|
||||||
NS_LITERAL_CSTRING(" is a directory or file")).get());
|
|
||||||
else if (dir) {
|
|
||||||
// make sure we have a trailing slash
|
|
||||||
escPath += "/";
|
escPath += "/";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
result = escPath;
|
result = escPath;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim:set ts=2 sw=2 et cindent: */
|
||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
|
@ -155,19 +156,17 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
|
||||||
// contains semicolons we need to manually escape them.
|
// contains semicolons we need to manually escape them.
|
||||||
escPath.ReplaceSubstring(";", "%3b");
|
escPath.ReplaceSubstring(";", "%3b");
|
||||||
|
|
||||||
// XXX this should be unnecessary
|
// if this file references a directory, then we need to ensure that the
|
||||||
|
// URL ends with a slash. this is important since it affects the rules
|
||||||
|
// for relative URL resolution when this URL is used as a base URL.
|
||||||
|
// if the file does not exist, then we make no assumption about its type,
|
||||||
|
// and simply leave the URL unmodified.
|
||||||
if (escPath.Last() != '/') {
|
if (escPath.Last() != '/') {
|
||||||
PRBool dir;
|
PRBool dir;
|
||||||
rv = aFile->IsDirectory(&dir);
|
rv = aFile->IsDirectory(&dir);
|
||||||
if (NS_FAILED(rv))
|
if (NS_SUCCEEDED(rv) && dir)
|
||||||
NS_WARNING(PromiseFlatCString(
|
|
||||||
NS_LITERAL_CSTRING("Cannot tell if ") + escPath +
|
|
||||||
NS_LITERAL_CSTRING(" is a directory or file")).get());
|
|
||||||
else if (dir) {
|
|
||||||
// make sure we have a trailing slash
|
|
||||||
escPath += "/";
|
escPath += "/";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
result = escPath;
|
result = escPath;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/* vim:set ts=4 sw=4 et cindent: */
|
||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
|
@ -67,19 +68,17 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
|
||||||
// contains semicolons we need to manually escape them.
|
// contains semicolons we need to manually escape them.
|
||||||
escPath.ReplaceSubstring(";", "%3b");
|
escPath.ReplaceSubstring(";", "%3b");
|
||||||
|
|
||||||
// XXX this should be unnecessary
|
// if this file references a directory, then we need to ensure that the
|
||||||
|
// URL ends with a slash. this is important since it affects the rules
|
||||||
|
// for relative URL resolution when this URL is used as a base URL.
|
||||||
|
// if the file does not exist, then we make no assumption about its type,
|
||||||
|
// and simply leave the URL unmodified.
|
||||||
if (escPath.Last() != '/') {
|
if (escPath.Last() != '/') {
|
||||||
PRBool dir;
|
PRBool dir;
|
||||||
rv = aFile->IsDirectory(&dir);
|
rv = aFile->IsDirectory(&dir);
|
||||||
if (NS_FAILED(rv))
|
if (NS_SUCCEEDED(rv) && dir)
|
||||||
NS_WARNING(PromiseFlatCString(
|
|
||||||
NS_LITERAL_CSTRING("Cannot tell if ") + escPath +
|
|
||||||
NS_LITERAL_CSTRING(" is a directory or file")).get());
|
|
||||||
else if (dir) {
|
|
||||||
// make sure we have a trailing slash
|
|
||||||
escPath += "/";
|
escPath += "/";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
result = escPath;
|
result = escPath;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/* vim:set ts=4 sw=4 et cindent: */
|
||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
|
@ -78,19 +79,17 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
|
||||||
// contains semicolons we need to manually escape them.
|
// contains semicolons we need to manually escape them.
|
||||||
escPath.ReplaceSubstring(";", "%3b");
|
escPath.ReplaceSubstring(";", "%3b");
|
||||||
|
|
||||||
// XXX this should be unnecessary
|
// if this file references a directory, then we need to ensure that the
|
||||||
if (escPath[escPath.Length() - 1] != '/') {
|
// URL ends with a slash. this is important since it affects the rules
|
||||||
|
// for relative URL resolution when this URL is used as a base URL.
|
||||||
|
// if the file does not exist, then we make no assumption about its type,
|
||||||
|
// and simply leave the URL unmodified.
|
||||||
|
if (escPath.Last() != '/') {
|
||||||
PRBool dir;
|
PRBool dir;
|
||||||
rv = aFile->IsDirectory(&dir);
|
rv = aFile->IsDirectory(&dir);
|
||||||
if (NS_FAILED(rv))
|
if (NS_SUCCEEDED(rv) && dir)
|
||||||
NS_WARNING(PromiseFlatCString(
|
|
||||||
NS_LITERAL_CSTRING("Cannot tell if ") + escPath +
|
|
||||||
NS_LITERAL_CSTRING(" is a directory or file")).get());
|
|
||||||
else if (dir) {
|
|
||||||
// make sure we have a trailing slash
|
|
||||||
escPath += "/";
|
escPath += "/";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
result = escPath;
|
result = escPath;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче