diff options
author | Kevin Walzer <kw@codebykevin.com> | 2017-05-06 15:37:27 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2017-05-06 15:37:27 (GMT) |
commit | cfbabe08a1a584f554365f7387e6c7a59799e0c8 (patch) | |
tree | 965894903baf8585abf6d2bcf46fd9b6cba99345 | |
parent | 8a4d0d14da64361e454f103ecd196a53318f1a32 (diff) | |
download | tk-cfbabe08a1a584f554365f7387e6c7a59799e0c8.zip tk-cfbabe08a1a584f554365f7387e6c7a59799e0c8.tar.gz tk-cfbabe08a1a584f554365f7387e6c7a59799e0c8.tar.bz2 |
tk_getSaveFile now correctly displays multiple file types with filtering on macOS
-rw-r--r-- | macosx/tkMacOSXDialog.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 9970bc1..ca55c60 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -725,6 +725,7 @@ Tk_GetSaveFileObjCmd( } } if (fl.filters || defaultType) { + saveFileTypes = [NSMutableArray array]; for (FileFilter *filterPtr = fl.filters; filterPtr; filterPtr = filterPtr->next) { for (FileFilterClause *clausePtr = filterPtr->clauses; clausePtr; @@ -733,8 +734,8 @@ Tk_GetSaveFileObjCmd( globPtr = globPtr->next) { str = globPtr->pattern; while (*str && (*str == '*' || *str == '.')) { - str++; - } + str++; + } if (*str) { type = [[NSString alloc] initWithUTF8String:str]; if (![saveFileTypes containsObject:type]) { |