diff --git a/uppsrc/TextDiffCtrl/PatchDiff.cpp b/uppsrc/TextDiffCtrl/PatchDiff.cpp index 575be8e6c..39c815a5b 100644 --- a/uppsrc/TextDiffCtrl/PatchDiff.cpp +++ b/uppsrc/TextDiffCtrl/PatchDiff.cpp @@ -76,7 +76,7 @@ PatchDiff::PatchDiff() Title("Patch"); } -bool PatchDiff::Open(const char *patch_path, const Vector& target_dirs) +bool PatchDiff::Open(const char *patch_path, const Vector& target_dirs0) { failed_count = 0; list.Clear(); @@ -84,6 +84,11 @@ bool PatchDiff::Open(const char *patch_path, const Vector& target_dirs) ShowResult(); patch_file <<= Null; target_dir <<= Null; + + Vector target_dirs; + for(String s : target_dirs0) + target_dirs.Add(UnixPath(s)); + DDUMP(target_dirs); Progress pi; if(!patch.Load(patch_path, pi)) { diff --git a/uppsrc/TextDiffCtrl/patch.cpp b/uppsrc/TextDiffCtrl/patch.cpp index d3f41d41a..c6e2e2a93 100644 --- a/uppsrc/TextDiffCtrl/patch.cpp +++ b/uppsrc/TextDiffCtrl/patch.cpp @@ -75,7 +75,7 @@ bool Patch::Load(Stream& in, Progress& pi) const Vector& h = file.GetKeys(); if(h.GetCount() == 0) return false; - common_path = h[0]; + common_path = GetFileFolder(h[0]); for(int i = 1; i < h.GetCount(); i++) common_path.Trim(MatchLen(common_path, h[i])); common_path.TrimEnd("/"); @@ -113,6 +113,7 @@ bool Patch::MatchFiles(const Vector& dir, Progress& pi) pi.SetText("Matching directories"); int best = 0; String com_path = common_path; + com_path.Replace("\\", "/"); while(com_path.GetCount()) { for(String d : dir) { while(d.GetCount() > 3) { diff --git a/uppsrc/ide/Errors.cpp b/uppsrc/ide/Errors.cpp index f6308ddf1..f9a918a5a 100644 --- a/uppsrc/ide/Errors.cpp +++ b/uppsrc/ide/Errors.cpp @@ -82,14 +82,12 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo& } catch(CParser::Error) {} const char *ms = p.GetPtr(); - f.kind = 3; - if(ln.Find("warning") >= 0) + if(ln.Find(": warning") >= 0) f.kind = 2; - else { - int q = ln.Find("error"); - if(q >= 0 && (q == 0 || !IsAlpha(ln[q - 1])) && (q + 5 >= ln.GetCount() || !IsAlpha(ln[q - 1]))) - f.kind = 1; - } + else if(ln.Find(": error") >= 0) + f.kind = 1; + else + f.kind = 3; const char *hs = ms; while(!IsLetter(*hs) && *hs) hs++;