while ((cp = strchr(fileName, '\\')) != 0) {
while ((cp = PL_strchr(fileName, '\\')) != 0) {
char *mangleResourceIntoFileURL(const char* aResourceFileName) {  // XXX For now, resources are not in jar files   // Find base path name to the resource file  char* resourceBase;  char* cp;#ifdef XP_PC  // XXX For now, all resources are relative to the .exe file  resourceBase = (char *)PR_Malloc(2000);;  DWORD mfnLen = GetModuleFileName(NULL, resourceBase, 2000);  // Truncate the executable name from the rest of the path...  cp = strrchr(resourceBase, '\\');  if (nsnull != cp) {    *cp = '\0';  }  // Change the first ':' into a '|'  cp = strchr(resourceBase, ':');  if (nsnull != cp) {      *cp = '|';  }#endif#ifdef XP_UNIX  // XXX For now, all resources are relative to the current working directory    FILE *pp;#define MAXPATHLEN 2000    resourceBase = (char *)PR_Malloc(MAXPATHLEN);;    if (!(pp = popen("pwd", "r"))) {      printf("RESOURCE protocol error in nsURL::mangeResourceIntoFileURL 1\n");      return(nsnull);    }    else {      if (fgets(resourceBase, MAXPATHLEN, pp)) {        printf("[%s] %d\n", resourceBase, PL_strlen(resourceBase));        resourceBase[PL_strlen(resourceBase)-1] = 0;      }      else {       printf("RESOURCE protocol error in nsURL::mangeResourceIntoFileURL 2\n");       return(nsnull);      }   }   printf("RESOURCE name %s\n", resourceBase);#endif  // Join base path to resource name  if (aResourceFileName[0] == '/') {    aResourceFileName++;  }  PRInt32 baseLen = strlen(resourceBase);  PRInt32 resLen = strlen(aResourceFileName);  PRInt32 totalLen = 8 + baseLen + 1 + resLen + 1;  char* fileName = (char *)PR_Malloc(totalLen);  PR_snprintf(fileName, totalLen, "file:///%s/%s", resourceBase, aResourceFileName);#ifdef XP_PC  // Change any backslashes into foreward slashes...  while ((cp = strchr(fileName, '\\')) != 0) {    *cp = '/';    cp++;  }#endif  PR_Free(resourceBase);  return fileName;}