Bug #231032 --> mailto: tag does not work with unescaped spaces (e.g., in subject)

port aviary 1.0 fix to the trunk

sr=bienvenu


git-svn-id: svn://10.0.0.236/trunk@166903 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scott%scott-macgregor.org
2004-12-21 00:06:10 +00:00
parent a15261d59b
commit 267ab9ada9

View File

@@ -159,15 +159,35 @@ nsCmdLineService::Initialize(int aArgc, char ** aArgv)
continue;
}
else {
// if this argument begins with mailto: then it needs to incorporate all subsequent arguments
// that come after it since mailto urls can have arbitrary unencoded spaces
if (!nsCRT::strncasecmp(aArgv[i], "mailto:", 7)) {
nsCAutoString mailtoUrl;
mailtoUrl += aArgv[i++];
for (; i < aArgc; i++)
{
mailtoUrl += " "; // we have to put the spaces separating the arguments back
mailtoUrl += aArgv[i];
}
mArgValueList.AppendElement(NS_REINTERPRET_CAST(void*, ToNewCString(mailtoUrl)));
mArgCount++;
// i should now == aArgc so we should naturally fall out of our outer for loop
} else if (i == (aArgc-1)) {
/* The next argument does not start with '-'. This
* could be value to the previous option
*/
if (i == (aArgc-1)) {
/* This is the last argument and a URL
* Append a PR_TRUE for the previous option in the value array
*/
mArgValueList.AppendElement(ProcessURLArg(aArgv[i]));
mArgCount++;
/* This is the last argument and a URL
* Append a PR_TRUE for the previous option in the value array
*/
mArgValueList.AppendElement(ProcessURLArg(aArgv[i]));
mArgCount++;
continue;
}
else {