mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed CheckAdjustFile in minidump debugging
This commit is contained in:
parent
28e55fd5aa
commit
287c91c4b7
1 changed files with 17 additions and 5 deletions
|
@ -3323,15 +3323,27 @@ namespace IDE.ui
|
||||||
|
|
||||||
void CheckAdjustFile()
|
void CheckAdjustFile()
|
||||||
{
|
{
|
||||||
if (mEditData == null)
|
var wantHash = mWantHash;
|
||||||
|
if (wantHash case .None)
|
||||||
|
{
|
||||||
|
if (mEditData != null)
|
||||||
|
{
|
||||||
|
if (!mEditData.mSHA256Hash.IsZero)
|
||||||
|
wantHash = .SHA256(mEditData.mSHA256Hash);
|
||||||
|
else if (!mEditData.mMD5Hash.IsZero)
|
||||||
|
wantHash = .MD5(mEditData.mMD5Hash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wantHash case .None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String text = scope .();
|
String text = scope .();
|
||||||
if (File.ReadAllText(mFilePath, text, true) case .Err)
|
if (File.ReadAllText(mFilePath, text, true) case .Err)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SourceHash textHash = SourceHash.Create(.MD5, text);
|
SourceHash textHash = SourceHash.Create(wantHash.GetKind(), text);
|
||||||
if (mEditData.CheckHash(textHash))
|
if (textHash == wantHash)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (text.Contains('\r'))
|
if (text.Contains('\r'))
|
||||||
|
@ -3342,8 +3354,8 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
text.Replace("\n", "\r\n");
|
text.Replace("\n", "\r\n");
|
||||||
}
|
}
|
||||||
textHash = SourceHash.Create(.MD5, text);
|
textHash = SourceHash.Create(wantHash.GetKind(), text);
|
||||||
if (mEditData.CheckHash(textHash))
|
if (textHash == wantHash)
|
||||||
{
|
{
|
||||||
if (File.WriteAllText(mFilePath, text) case .Err)
|
if (File.WriteAllText(mFilePath, text) case .Err)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue