Commit 55ef0aec authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix #76: fluid~-help.pd can't be opened

escape "\r" coming from Pd before evaluating
parent 04f8e266
......@@ -346,6 +346,10 @@ function gui_post_error(objectid, loglevel, errormsg) {
}
}
function gui_legacy_tcl_command(file, line_number, text) {
post("legacy tcl command at " + line_number + " of " + file + ": " + text);
}
function clear_console() {
var container = pd_window.document.getElementById("p1");
container.textContent = "";
......@@ -1182,6 +1186,7 @@ function init_socket_events () {
// Turn newlines into backslash + "n" so
// eval will do the right thing with them
next_command = next_command.replace(/\n/g, "\\n");
next_command = next_command.replace(/\r/g, "\\r");
selector = next_command.slice(0, next_command.indexOf(" "));
args = next_command.slice(selector.length + 1);
next_command = "";
......
......@@ -745,17 +745,6 @@ void sys_vvguid(const char *file, int line, const char *fmt, va_list ap) {
sys_vvgui(fmt,ap);
}
/* Old GUI command interface... */
void sys_vguid(const char *file, int line, const char *fmt, ...) {
va_list ap;
char buf[MAXPDSTRING];
va_start(ap, fmt);
vsnprintf(buf, MAXPDSTRING-1, fmt, ap);
va_end(ap);
/* For old commands, we're just posting them to the pd console */
post("Old command at %s:%d:%s", file, line, buf);
//sys_vvguid(file,line,fmt,ap);
}
void sys_gui(const char *s)
{
sys_vgui("%s", s);
......@@ -943,6 +932,19 @@ void gui_end_array(void)
gui_array_tail = 1;
}
/* Old GUI command interface... */
void sys_vguid(const char *file, int line, const char *fmt, ...) {
va_list ap;
char buf[MAXPDSTRING];
va_start(ap, fmt);
vsnprintf(buf, MAXPDSTRING-1, fmt, ap);
va_end(ap);
/* For old commands, we're just posting them to the pd console */
gui_vmess("gui_legacy_tcl_command", "sis",
file, line, buf);
//sys_vvguid(file,line,fmt,ap);
}
int sys_flushtogui( void)
{
int writesize = sys_guibufhead - sys_guibuftail, nwrote = 0;
......@@ -1347,8 +1349,8 @@ fprintf(stderr, "guidir is %s\n", guidir);
sprintf(cmdbuf,
"%s/nw/nw %s %d localhost %s %s\n",
guidir,
guidir,
// "/home/user/pd-nw/pd/nw",
// guidir,
"/home/user/purr-data/pd/nw",
portno,
(sys_k12_mode ? "pd-l2ork-k12" : "pd-l2ork"),
guidir);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment