diff --git a/libhac/Romfs.cs b/libhac/Romfs.cs index 111106e7..0359d970 100644 --- a/libhac/Romfs.cs +++ b/libhac/Romfs.cs @@ -104,19 +104,27 @@ namespace libhac private void ResolveFilenames() { + var list = new List(); var sb = new StringBuilder(); + var delimiter = "/"; foreach (var file in Files) { - sb.Append(file.Name); + list.Add(file.Name); var dir = file.ParentDir; while (dir != null) { - sb.Insert(0, "/"); - sb.Insert(0, dir.Name); + list.Add(delimiter); + list.Add(dir.Name); dir = dir.Parent; } + for (int i = list.Count-1; i >= 0; i--) + { + sb.Append(list[i]); + } + file.FullPath = sb.ToString(); + list.Clear(); sb.Clear(); } }