(WagOpener): strip possible drive specification from file names.

This commit is contained in:
morkt 2015-08-17 07:08:49 +04:00
parent 6b62a1701d
commit 6acb80e5fd

View File

@ -28,6 +28,7 @@ using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using GameRes.Utility;
namespace GameRes.Formats.Xuse
@ -161,7 +162,7 @@ namespace GameRes.Formats.Xuse
Entry entry;
if (!string.IsNullOrEmpty (filename))
{
filename = filename.TrimStart ('\\');
filename = DriveRe.Replace (filename, "");
entry = FormatCatalog.Instance.CreateEntry (filename);
}
else
@ -178,6 +179,8 @@ namespace GameRes.Formats.Xuse
return new WagArchive (file, this, dir, data_key);
}
static readonly Regex DriveRe = new Regex (@"^(?:.+:)?\\+");
public override Stream OpenEntry (ArcFile arc, Entry entry)
{
var warc = arc as WagArchive;