Hi,
IOhannes m zmoelnig wrote:
[...]
or - if you prefer built-ins like me- use [makefilename %c]
I mentioned this before but maybe it was the wrong thread, anyway I'm still interested what happens on other systems with this:
[123] | [makefilename %c] | [symbol]
Here (0.38.3 and 0.39.0, on XP) it freezes the patch. This happens only with 123 and the connection to [symbol].
Sigi
s.koepf wrote:
Hi,
IOhannes m zmoelnig wrote:
[...]
or - if you prefer built-ins like me- use [makefilename %c]
I mentioned this before but maybe it was the wrong thread, anyway I'm still interested what happens on other systems with this:
[123] | [makefilename %c] | [symbol]
Here (0.38.3 and 0.39.0, on XP) it freezes the patch. This happens only with 123 and the connection to [symbol].
hi
your patch does not freeze anything on my machine, but this is only because [symbol] denotes (in my world) and object called "symbol". what you mean is rather a symbol-box (Ctrl-4), which could be represented better (imho) by [symbol\
now why? the solution is pretty simple: pd does a very bad job when it comes to escaping special characters. "{" and "}" are such special characters (in tcl world); this is why they are banned from normal user-input. however, 123 is the ascii value of "{", and by using [symbol\ you are sending this special symbol to the pd-gui (tcl/tk!); now tcl uses "{" for starting a list and WAITS for "}" to end the list. if you manage to send "}" (ascii 125) to the pd-gui, pd will unfreeze and everything is fine again.
example:
[123, 125( | [makefilename %c] | [symbol\
mf.ar. IOhannes
IOhannes m zmoelnig wrote:
s.koepf wrote:
Hi,
IOhannes m zmoelnig wrote:
[...]
or - if you prefer built-ins like me- use [makefilename %c]
I mentioned this before but maybe it was the wrong thread, anyway I'm still interested what happens on other systems with this:
[123] | [makefilename %c] | [symbol]
Here (0.38.3 and 0.39.0, on XP) it freezes the patch. This happens only with 123 and the connection to [symbol].
hi
your patch does not freeze anything on my machine, but this is only because [symbol] denotes (in my world) and object called "symbol". what you mean is rather a symbol-box (Ctrl-4), which could be represented better (imho) by [symbol\
now why? the solution is pretty simple: pd does a very bad job when it comes to escaping special characters. "{" and "}" are such special characters (in tcl world); this is why they are banned from normal user-input. however, 123 is the ascii value of "{", and by using [symbol\ you are sending this special symbol to the pd-gui (tcl/tk!); now tcl uses "{" for starting a list and WAITS for "}" to end the list. if you manage to send "}" (ascii 125) to the pd-gui, pd will unfreeze and everything is fine again.
example:
[123, 125( | [makefilename %c] | [symbol\
Thanks IOhannes,
I followed many ot those dicussions on the subject on this list, but what I never saw is a complete list of all "dangerous" characters in pd/tcl/tk. Would be nice to have one.
Sigi
s.koepf wrote:
the solution is pretty simple: pd does a very bad job when it comes to escaping special characters. "{" and "}" are such special characters (in tcl world); this is why they are banned from normal user-input. however, 123 is the ascii value of "{", and by using [symbol\ you are sending this special symbol to the pd-gui (tcl/tk!); now tcl uses "{" for starting a list and WAITS for "}" to end the list. if you manage to send "}" (ascii 125) to the pd-gui, pd will unfreeze and everything is fine again.
example:
[123, 125( | [makefilename %c] | [symbol\
Thanks IOhannes,
I followed many ot those dicussions on the subject on this list, but what I never saw is a complete list of all "dangerous" characters in pd/tcl/tk. Would be nice to have one.
Here on WinXP and Miller's pd039_test7 it's the [print] that does it. [symbol] on its own is OK. In the source code s_print.c it looks like four characters are escaped: '', '{', '}', and ';'. But if they are escaped they should not freeze the gui...
static void dopost(const char *s) { ... if (c == '\' || c == '{' || c == '}' || c == ';') <- if it's a dangerous character for tcl upbuf[ptout++] = '\'; <- add a backslash before the dangerous character upbuf[ptout] = s[ptin]; <- then put the character ... sys_vgui("pdtk_post {%s}\n", upbuf); <- then send it to tcl interpreter
If I try entering them in a print box I get different results. '' and '}' are rejected: }: dropped \: dropped ';' is accepted '{' freezes the gui.
In g_editor.c:
void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) {
... if (keynum == '\' || keynum == '{' || keynum == '}') <-a dangerous character { post("%c: dropped", (int)keynum); <-should be dropped, but for '{' this doesn't get printed return; } ...dopost() is called from post() so '{' is causing trouble even when it is escaped with a backslash.
Martin
It would be great to have all this info in a bug report:
http://puredata.org/dev/bugtracker/
.hc
On Nov 17, 2005, at 11:41 AM, Martin Peach wrote:
s.koepf wrote:
the solution is pretty simple: pd does a very bad job when it comes
to escaping special characters. "{" and "}" are such special
characters (in tcl world); this is why they are banned from normal
user-input. however, 123 is the ascii value of "{", and by using [symbol\ you
are sending this special symbol to the pd-gui (tcl/tk!); now tcl
uses "{" for starting a list and WAITS for "}" to end the list. if you manage to send "}" (ascii 125) to the pd-gui, pd will
unfreeze and everything is fine again.example:
[123, 125( | [makefilename %c] | [symbol\
Thanks IOhannes,
I followed many ot those dicussions on the subject on this list, but
what I never saw is a complete list of all "dangerous" characters in
pd/tcl/tk. Would be nice to have one.Here on WinXP and Miller's pd039_test7 it's the [print] that does it.
[symbol] on its own is OK. In the source code s_print.c it looks like four characters are
escaped: '', '{', '}', and ';'. But if they are escaped they should not freeze the gui...static void dopost(const char *s) { ... if (c == '\' || c == '{' || c == '}' || c == ';') <- if
it's a dangerous character for tcl upbuf[ptout++] = '\'; <- add a backslash before the
dangerous character upbuf[ptout] = s[ptin]; <- then put the character ... sys_vgui("pdtk_post {%s}\n", upbuf); <- then send it to tcl
interpreterIf I try entering them in a print box I get different results. '' and
'}' are rejected: }: dropped \: dropped ';' is accepted '{' freezes the gui.In g_editor.c:
void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) {
... if (keynum == '\' || keynum == '{' || keynum == '}') <-a dangerous
character { post("%c: dropped", (int)keynum); <-should be dropped, but for
'{' this doesn't get printed return; } ...dopost() is called from post() so '{' is causing trouble even when
it is escaped with a backslash.Martin
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Using ReBirth is like trying to play an 808 with a long stick. -David Zicarelli