From f65a99f7edca871fe2771acc331b7da736168075 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 31 Dec 2013 16:19:44 +0000 Subject: [PATCH] CtrlLib: FileSel: Fixed issues with quotes git-svn-id: svn://ultimatepp.org/upp/trunk@6707 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/FileSel.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/uppsrc/CtrlLib/FileSel.cpp b/uppsrc/CtrlLib/FileSel.cpp index 92f98b7cf..9ccd0a3be 100644 --- a/uppsrc/CtrlLib/FileSel.cpp +++ b/uppsrc/CtrlLib/FileSel.cpp @@ -875,6 +875,9 @@ String TrimDot(String f) { void FileSel::AddName(Vector& fn, String& f) { if(!f.IsEmpty()) { + f = TrimDot(f); + if(f[0] == '\"' && f.GetCount() > 2) + f = f.Mid(1, f.GetCount() - 2); if(f.Find('.') < 0) { String t = GetMask(); int q = t.Find('.'); @@ -888,11 +891,7 @@ void FileSel::AddName(Vector& fn, String& f) { if(defext.GetCount()) f << '.' << defext; } - f = TrimDot(f); - if(f[0] == '\"' && f.GetCount() > 2) - fn.Add(f.Mid(1, f.GetCount() - 2)); - else - fn.Add(f); + fn.Add(f); } f.Clear(); } @@ -938,10 +937,7 @@ void FileSel::Finish() { AddName(fn, o); s++; for(;;) { - if(*s == '\0') - AddName(fn, o); - else - if(*s == '\"') { + if(*s == '\0' || *s == '\"') { AddName(fn, o); break; }