Changeset 207


Ignore:
Timestamp:
Dec 9, 2010, 3:34:37 PM (15 years ago)
Author:
dmik
Message:

jdk: FontConfiguration: Replace / and \ in the "os.name" property with "_" when building the platform-specific fontconfig file name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/share/classes/sun/awt/FontConfiguration.java

    r2 r207  
    212212        String baseName = javaLib + File.separator + "fontconfig";
    213213        File configFile;
    214         if (osVersion != null && osName != null) {
    215             configFile = findImpl(baseName + "." + osName + "." + osVersion);
     214        /* osName may contain \ and / chars that we certainly don't want to be
     215           interpreted as path separators in the code below, fix it */
     216        String osNameFixed = null;
     217        if (osName != null) {
     218            osNameFixed = osName.replace('\\', '_').replace('/', '_');
     219        }
     220        if (osVersion != null && osNameFixed != null) {
     221            configFile = findImpl(baseName + "." + osNameFixed + "." + osVersion);
    216222            if (configFile != null) {
    217223                return configFile;
    218224            }
    219225        }
    220         if (osName != null) {
    221             configFile = findImpl(baseName + "." + osName);
     226        if (osNameFixed != null) {
     227            configFile = findImpl(baseName + "." + osNameFixed);
    222228            if (configFile != null) {
    223229                return configFile;
Note: See TracChangeset for help on using the changeset viewer.