зеркало из https://github.com/mozilla/gecko-dev.git
fixes bug 151843 "nsIFile::Append inconsistent across platforms" r=dougt sr=alecf
This commit is contained in:
Родитель
f4657b3169
Коммит
4cf9b72205
|
@ -1492,7 +1492,7 @@ NS_IMETHODIMP
|
|||
nsLocalFile::AppendNative(const nsACString &aNode)
|
||||
{
|
||||
if (aNode.IsEmpty())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
return NS_OK;
|
||||
|
||||
nsACString::const_iterator start, end;
|
||||
aNode.BeginReading(start);
|
||||
|
|
|
@ -783,12 +783,14 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
|||
NS_IMETHODIMP
|
||||
nsLocalFile::AppendNative(const nsACString &node)
|
||||
{
|
||||
if (node.IsEmpty())
|
||||
return NS_OK;
|
||||
|
||||
// Append only one component. Check for subdirs.
|
||||
// XXX can we avoid the PromiseFlatCString call?
|
||||
if (node.IsEmpty() || (_mbschr((const unsigned char*) PromiseFlatCString(node).get(), '\\') != nsnull))
|
||||
{
|
||||
if (_mbschr((const unsigned char*) PromiseFlatCString(node).get(), '\\') != nsnull)
|
||||
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
|
||||
}
|
||||
|
||||
return AppendRelativeNativePath(node);
|
||||
}
|
||||
|
||||
|
|
|
@ -845,12 +845,14 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
|||
NS_IMETHODIMP
|
||||
nsLocalFile::AppendNative(const nsACString &node)
|
||||
{
|
||||
if (node.IsEmpty())
|
||||
return NS_OK;
|
||||
|
||||
// Append only one component. Check for subdirs.
|
||||
// XXX can we avoid the PromiseFlatCString call?
|
||||
if (node.IsEmpty() || (_mbschr((const unsigned char*) PromiseFlatCString(node).get(), '\\') != nsnull))
|
||||
{
|
||||
if (_mbschr((const unsigned char*) PromiseFlatCString(node).get(), '\\') != nsnull)
|
||||
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
|
||||
}
|
||||
|
||||
return AppendRelativeNativePath(node);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче