fixed execution order bug that was causing the first two frame numbers to output...
[puredata.git] / packages / patches / add_mxt_file_extension_support-0.41.4.patch
blob17ae830e02bdec34b7febdf0c1ac0f127a70463b
1 Index: u_main.tk
2 ===================================================================
3 --- u_main.tk (revision 10595)
4 +++ u_main.tk (working copy)
5 @@ -29,7 +29,8 @@
6 # set file types that open/save recognize
7 set filetypes {
8 {{Pd Files} {.pd} }
9 - {{Max Text Files} {.pat} }
10 + {{Max Patch Files} {.pat} }
11 + {{Max Text Files} {.mxt} }
13 } elseif { $tcl_platform(os) == "Darwin" } {
14 set pd_nt 2
15 @@ -47,7 +48,8 @@
16 # set file types that open/save recognize
17 set filetypes {
18 {{Pd Files} {.pd} }
19 - {{Max Text Files (.pat)} {.pat} }
20 + {{Max Patch Files (.pat)} {.pat} }
21 + {{Max Text Files (.mxt)} {.mxt} }
23 } else {
24 set pd_nt 0
25 @@ -65,7 +67,8 @@
26 # set file types that open/save recognize
27 set filetypes {
28 {{pd files} {.pd} }
29 - {{max text files} {.pat} }
30 + {{max patch files} {.pat} }
31 + {{max text files} {.mxt} }
35 Index: m_binbuf.c
36 ===================================================================
37 --- m_binbuf.c (revision 10506)
38 +++ m_binbuf.c (working copy)
39 @@ -870,7 +870,8 @@
40 if (*dir)
41 strcat(fbuf, dir), strcat(fbuf, "/");
42 strcat(fbuf, filename);
43 - if (!strcmp(filename + strlen(filename) - 4, ".pat"))
44 + if (!strcmp(filename + strlen(filename) - 4, ".pat") ||
45 + !strcmp(filename + strlen(filename) - 4, ".mxt"))
47 x = binbuf_convert(x, 0);
48 deleteit = 1;
49 @@ -1348,7 +1349,8 @@
50 void binbuf_evalfile(t_symbol *name, t_symbol *dir)
52 t_binbuf *b = binbuf_new();
53 - int import = !strcmp(name->s_name + strlen(name->s_name) - 4, ".pat");
54 + int import = !strcmp(name->s_name + strlen(name->s_name) - 4, ".pat") ||
55 + !strcmp(name->s_name + strlen(name->s_name) - 4, ".mxt");
56 /* set filename so that new canvases can pick them up */
57 int dspstate = canvas_suspend_dsp();
58 glob_setfilename(0, name, dir);
59 Index: g_readwrite.c
60 ===================================================================
61 --- g_readwrite.c (revision 10497)
62 +++ g_readwrite.c (working copy)
63 @@ -728,7 +728,8 @@
64 t_canvas *x2 = canvas_getrootfor(x);
65 char *name = x2->gl_name->s_name;
66 if (*name && strncmp(name, "Untitled", 8)
67 - && (strlen(name) < 4 || strcmp(name + strlen(name)-4, ".pat")))
68 + && (strlen(name) < 4 || strcmp(name + strlen(name)-4, ".pat")
69 + || strcmp(name + strlen(name)-4, ".mxt")))
70 canvas_savetofile(x2, x2->gl_name, canvas_getdir(x2));
71 else canvas_menusaveas(x2);
73 Index: u_main.tk
74 ===================================================================
75 --- u_main.tk (revision 10609)
76 +++ u_main.tk (working copy)
77 @@ -521,7 +521,7 @@
78 set directory [string range $filename 0 [expr [string last / $filename] - 1]]
79 set pd_opendir $directory
80 set basename [string range $filename [expr [string last / $filename] + 1] end]
81 - if {[string last .pd $filename] >= 0} {
82 + if {[regexp -nocase -- "\.(pd|pat|mxt)$" $filename]} {
83 pd "pd open [pdtk_enquote $basename] [pdtk_enquote $directory] ;"