rv = lf->InitWithNativePath(BPath.Path());
rv = lf->InitWithNativePath(nsDependentCString(resolved.Path()));
nsCommandLine::ResolveFile(const nsAString& aArgument, nsIFile* *aResult){  NS_ENSURE_TRUE(mWorkingDir, NS_ERROR_NOT_INITIALIZED);  // This is some seriously screwed-up code. nsILocalFile.appendRelativeNativePath  // explicitly does not accept .. or . path parts, but that is exactly what we  // need here. So we hack around it.  nsresult rv;#if defined(XP_MACOSX)  nsCOMPtr<nsILocalFileMac> lfm (do_QueryInterface(mWorkingDir));  NS_ENSURE_TRUE(lfm, NS_ERROR_NO_INTERFACE);  nsCOMPtr<nsILocalFileMac> newfile (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));  NS_ENSURE_TRUE(newfile, NS_ERROR_OUT_OF_MEMORY);  CFURLRef baseurl;  rv = lfm->GetCFURL(&baseurl);  NS_ENSURE_SUCCESS(rv, rv);  nsCAutoString path;  NS_CopyUnicodeToNative(aArgument, path);  CFURLRef newurl =    CFURLCreateFromFileSystemRepresentationRelativeToBase(NULL, (const UInt8*) path.get(),                                                          path.Length(),                                                          true, baseurl);  CFRelease(baseurl);  rv = newfile->InitWithCFURL(newurl);  CFRelease(newurl);  if (NS_FAILED(rv)) return rv;  NS_ADDREF(*aResult = newfile);  return NS_OK;#elif defined(XP_BEOS)  nsCOMPtr<nsILocalFile> lf (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));  NS_ENSURE_TRUE(lf, NS_ERROR_OUT_OF_MEMORY);  if (aArgument.First() == '/') {    // absolute path    rv = lf->InitWithPath(aArgument);    if (NS_FAILED(rv)) return rv;    NS_ADDREF(*aResult = lf);    return NS_OK;  }  nsCAutoString carg;  NS_CopyUnicodeToNative(aArgument, carg);  nsCAutoString wd;  rv = mWorkingDir->GetNativePath(wd);  NS_ENSURE_SUCCESS(rv, rv);  BDirectory bwd(wd.get());  BPath resolved(bwd, carg.get(), true);  if (resolved.InitCheck() != B_OK)    return NS_ERROR_FAILURE;  rv = lf->InitWithNativePath(BPath.Path());  if (NS_FAILED(rv)) return rv;  NS_ADDREF(*aResult = lf);  return NS_OK;#elif defined(XP_UNIX)  nsCOMPtr<nsILocalFile> lf (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));  NS_ENSURE_TRUE(lf, NS_ERROR_OUT_OF_MEMORY);  if (aArgument.First() == '/') {    // absolute path    rv = lf->InitWithPath(aArgument);    if (NS_FAILED(rv)) return rv;    NS_ADDREF(*aResult = lf);    return NS_OK;  }  nsCAutoString nativeArg;  NS_CopyUnicodeToNative(aArgument, nativeArg);  nsCAutoString newpath;  mWorkingDir->GetNativePath(newpath);  newpath.Append('/');  newpath.Append(nativeArg);  rv = lf->InitWithNativePath(newpath);  if (NS_FAILED(rv)) return rv;  rv = lf->Normalize();  if (NS_FAILED(rv)) return rv;  NS_ADDREF(*aResult = lf);  return NS_OK;#elif defined(XP_WIN32) || defined(XP_OS2)  nsCOMPtr<nsILocalFile> lf (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));  NS_ENSURE_TRUE(lf, NS_ERROR_OUT_OF_MEMORY);  rv = lf->InitWithPath(aArgument);  if (NS_FAILED(rv)) {    // If it's a relative path, the Init is *going* to fail. We use string magic and    // win32 _fullpath. Note that paths of the form "\Relative\To\CurDrive" are    // going to fail, and I haven't figured out a way to work around this without    // the PathCombine() function, which is not available in plain win95/nt4    nsCAutoString fullPath;    mWorkingDir->GetNativePath(fullPath);    nsCAutoString carg;    NS_CopyUnicodeToNative(aArgument, carg);    fullPath.Append('\\');    fullPath.Append(carg);    char pathBuf[MAX_PATH];    if (!_fullpath(pathBuf, fullPath.get(), MAX_PATH))      return NS_ERROR_FAILURE;    rv = lf->InitWithNativePath(nsDependentCString(pathBuf));    if (NS_FAILED(rv)) return rv;  }  NS_ADDREF(*aResult = lf);  return NS_OK;#else#error Need platform-specific logic here.#endif}