CtrlLib: FileSel: Fixed issues with quotes

git-svn-id: svn://ultimatepp.org/upp/trunk@6707 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-12-31 16:19:44 +00:00
parent 8282376b90
commit f65a99f7ed

View file

@ -875,6 +875,9 @@ String TrimDot(String f) {
void FileSel::AddName(Vector<String>& 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<String>& 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;
}