summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2017-05-06 15:37:27 (GMT)
committerKevin Walzer <kw@codebykevin.com>2017-05-06 15:37:27 (GMT)
commitcfbabe08a1a584f554365f7387e6c7a59799e0c8 (patch)
tree965894903baf8585abf6d2bcf46fd9b6cba99345 /macosx
parent8a4d0d14da64361e454f103ecd196a53318f1a32 (diff)
downloadtk-cfbabe08a1a584f554365f7387e6c7a59799e0c8.zip
tk-cfbabe08a1a584f554365f7387e6c7a59799e0c8.tar.gz
tk-cfbabe08a1a584f554365f7387e6c7a59799e0c8.tar.bz2
tk_getSaveFile now correctly displays multiple file types with filtering on macOS
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXDialog.c5
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]) {