Skip to content

Commit 25800de

Browse files
committed
Make path expansion consistent.
1 parent c5d4667 commit 25800de

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Source/ORTS.Common/SettingsBase.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ public String GetSettingsStoreName()
157157

158158
/// <summary>
159159
/// Change the settings store. Creates a new SettingsStore based on the provided parameters.
160-
/// See also SettingsStore.GetSettingStore().
160+
/// Only one of filePath and registry key should be specified. If both are provided, filePath
161+
/// prevails. Does not change the static locations (as that would affect other objects).
162+
/// See also SettingsStore.GetSettingStore() and OverrideSettingsLocations().
161163
/// </summary>
162164
/// <param name="filePath">The path to the INI file, or NULL if using the registry.</param>
163165
/// <param name="registryKey">The registry key (name), or NULL if using an INI file. </param>
@@ -169,7 +171,8 @@ public virtual void ChangeSettingsStore(string filePath, string registryKey, str
169171
SettingStore.Discard();
170172
SettingStore = null;
171173
}
172-
SettingStore = SettingsStore.GetSettingStore(filePath, registryKey, section);
174+
var fullPath = String.IsNullOrEmpty(filePath) ? null : Path.Combine(ApplicationInfo.ProcessDirectory, filePath);
175+
SettingStore = SettingsStore.GetSettingStore(fullPath, registryKey, section);
173176
}
174177

175178
/// <summary>

0 commit comments

Comments
 (0)