int L = PL_strlen(result);
int L = nsCRT::strlen(result);
mime_set_url_part(const char *url, char *part, PRBool append_p){  const char *part_begin = 0;  const char *part_end = 0;  PRBool got_q = PR_FALSE;  const char *s;  char *result;  for (s = url; *s; s++)	{	  if (*s == '?')		{		  got_q = PR_TRUE;		  if (!PL_strncasecmp(s, "?part=", 6))			part_begin = (s += 6);		}	  else if (got_q && *s == '&' && !PL_strncasecmp(s, "&part=", 6))		part_begin = (s += 6);	  if (part_begin)		{		  for (; (*s && *s != '?' && *s != '&'); s++)			;		  part_end = s;		  break;		}	}  result = (char *) PR_MALLOC(PL_strlen(url) + PL_strlen(part) + 10);  if (!result) return 0;  if (part_begin)	{	  if (append_p)		{		  nsCRT::memcpy(result, url, part_end - url);		  result [part_end - url]     = '.';		  result [part_end - url + 1] = 0;		}	  else		{		  nsCRT::memcpy(result, url, part_begin - url);		  result [part_begin - url] = 0;		}	}  else	{	  PL_strcpy(result, url);	  if (got_q)		PL_strcat(result, "&part=");	  else		PL_strcat(result, "?part=");	}  PL_strcat(result, part);  if (part_end && *part_end)	PL_strcat(result, part_end);  /* Semi-broken kludge to omit a trailing "?part=0". */  {	int L = PL_strlen(result);	if (L > 6 &&		(result[L-7] == '?' || result[L-7] == '&') &&		!PL_strcmp("part=0", result + L - 6))	  result[L-7] = 0;  }  return result;}