Pier Angelo Vendrame pushed to branch mullvad-browser-128.5.0esr-14.5-1 at The Tor Project / Applications / Mullvad Browser

Commits:

1 changed file:

Changes:

  • gfx/thebes/gfxFcPlatformFontList.cpp
    ... ... @@ -1356,20 +1356,20 @@ static nsresult SetFontconfigConfigFile() {
    1356 1356
       nsCOMPtr<nsIProperties> dirSvc(
    
    1357 1357
           do_GetService("@mozilla.org/file/directory_service;1"));
    
    1358 1358
       NS_ENSURE_TRUE(dirSvc, NS_ERROR_NOT_AVAILABLE);
    
    1359
    -  nsCOMPtr<nsIFile> appFile, confFile;
    
    1359
    +  nsCOMPtr<nsIFile> appFile, confDir;
    
    1360 1360
       nsresult rv = dirSvc->Get(XRE_EXECUTABLE_FILE, NS_GET_IID(nsIFile),
    
    1361 1361
                                 getter_AddRefs(appFile));
    
    1362 1362
       NS_ENSURE_SUCCESS(rv, rv);
    
    1363
    -  rv = appFile->GetParent(getter_AddRefs(confFile));
    
    1363
    +  rv = appFile->GetParent(getter_AddRefs(confDir));
    
    1364 1364
       NS_ENSURE_SUCCESS(rv, rv);
    
    1365
    -  rv = confFile->AppendNative("fonts"_ns);
    
    1366
    -  NS_ENSURE_SUCCESS(rv, rv);
    
    1367
    -  rv = confFile->AppendNative("fonts.conf"_ns);
    
    1365
    +  rv = confDir->AppendNative("fonts"_ns);
    
    1368 1366
       NS_ENSURE_SUCCESS(rv, rv);
    
    1369 1367
     
    
    1370 1368
       nsAutoCString confPath;
    
    1371
    -  rv = confFile->GetNativePath(confPath);
    
    1372
    -  if (setenv("FONTCONFIG_FILE", confPath.BeginReading(), 1) != 0) {
    
    1369
    +  rv = confDir->GetNativePath(confPath);
    
    1370
    +  NS_ENSURE_SUCCESS(rv, rv);
    
    1371
    +  if (NS_WARN_IF(setenv("FONTCONFIG_PATH", confPath.BeginReading(), 1) != 0 ||
    
    1372
    +                 setenv("FONTCONFIG_FILE", "fonts.conf", 1) != 0)) {
    
    1373 1373
         return NS_ERROR_FAILURE;
    
    1374 1374
       }
    
    1375 1375
       return NS_OK;