The number of variants should always start at 1.

git-svn-id: svn://10.0.0.236/trunk@28336 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
amusil%netscape.com
1999-04-20 22:22:02 +00:00
parent 877fa6ac98
commit 32b82cd775
2 changed files with 14 additions and 6 deletions

View File

@@ -67,7 +67,7 @@ static char* GetKeyValue(char* verbuf, char* key)
static PRUint32 CalculateVariantCount(char* mimeTypes)
{
PRUint32 variants = 0;
PRUint32 variants = 1;
char* index = mimeTypes;
while (*index)
{
@@ -86,13 +86,17 @@ static char** MakeStringArray(PRUint32 variants, char* data)
PRUint32 count = 0;
buffer = (char **)PR_Malloc(variants * sizeof(char *));
buffer[count++] = index;
if(!buffer)
return NULL;
buffer[count] = index;
++count;
while (*index && count<variants)
{
if (*index == '|')
{
buffer[count++] = index + 1;
buffer[count] = index + 1;
++count;
*index = 0;
}
++index;

View File

@@ -67,7 +67,7 @@ static char* GetKeyValue(char* verbuf, char* key)
static PRUint32 CalculateVariantCount(char* mimeTypes)
{
PRUint32 variants = 0;
PRUint32 variants = 1;
char* index = mimeTypes;
while (*index)
{
@@ -86,13 +86,17 @@ static char** MakeStringArray(PRUint32 variants, char* data)
PRUint32 count = 0;
buffer = (char **)PR_Malloc(variants * sizeof(char *));
buffer[count++] = index;
if(!buffer)
return NULL;
buffer[count] = index;
++count;
while (*index && count<variants)
{
if (*index == '|')
{
buffer[count++] = index + 1;
buffer[count] = index + 1;
++count;
*index = 0;
}
++index;