Fr33dan/GPSaveConverter

Escape character inserted while creating Xbox save file

Opened this issue · 2 comments

nypoCJ commented

Hi,

Here is a description of the bug which I believe is called an "Escape character" :

Context: When converting a non-Xbox save file to an Xbox save file, an issue arises where files containing a . or / result in an additional / being inserted.

Example: A non-Xbox file named peru_123abc.dat, when added to the Xbox container, is transformed into peru_123abc/.dat

Note: This behavior occurs with the default regex rule. It also happens when attempting to modify the regex to remove.dat from the non-Xbox file and then re-add .dat to the Xbox Blob ID using a pattern like ${FileName}.dat.

Thanks for your help

It might be this line doing it, will have to investigate more

string xboxFileID = Regex.Escape(Regex.Replace(file.RelativePath, t.NonXboxFilenameRegex, t.XboxFileID));

It might be this line doing it, will have to investigate more

I think you are right. We need to escape the regex for the Where condition, but then use the unescaped value for AddFile