the patch (I forgot...)
Nicola Bernardini
nicb at axnet.it
Fri Feb 6 23:23:33 CET 1998
(Sorry, I forgot to append the patch. Here it is...)
Nicola
------------------------------------------------------------------------
Nicola Bernardini
E-mail: nicb at axnet.it
Re graphics: A picture is worth 10K words -- but only those to describe
the picture. Hardly any sets of 10K words can be adequately described
with pictures.
--- ./s_inter.c.orig Thu Feb 5 08:35:00 1998
+++ ./s_inter.c Thu Feb 5 09:19:51 1998
@@ -60,6 +60,9 @@
static t_binbuf *inbinbuf;
static t_socketreceiver *sys_socketreceiver;
+static char *s_tcl_libdir = (char *) NULL;
+static char *s_tk_libdir = (char *) NULL;
+
void sys_sockerror(char *s)
{
#ifdef NT
@@ -318,12 +321,14 @@
}
else /* we're the child */
{
+ char *sys_getenv(const char *e); /* in s_linux.c (at least) */
+ s_tcl_libdir = sys_getenv("TCL_LIBRARY");
+ s_tk_libdir = sys_getenv("TK_LIBRARY");
dup2(pipeto[0], 0);
close(pipeto[0]);
close(pipeto[1]);
- sprintf(cmdbuf,
- "TCL_LIBRARY=%s/tcl/library TK_LIBRARY=%s/tk/library %s/bin/pd-gui %d\n",
- sys_progdir->s_name, sys_progdir->s_name, sys_progdir->s_name,
+ sprintf(cmdbuf, "TCL_LIBRARY=%s TK_LIBRARY=%s %s/bin/pd-gui %d\n",
+ s_tcl_libdir, s_tk_libdir, sys_progdir->s_name,
portno);
fprintf(stderr, "%s", cmdbuf);
execl("/bin/sh", "sh", "-c", cmdbuf, 0);
--- ./s_linux.c.orig Thu Feb 5 08:45:51 1998
+++ ./s_linux.c Thu Feb 5 08:49:12 1998
@@ -616,3 +616,15 @@
{
return (cp_ch);
}
+
+#include <stdlib.h>
+
+char *sys_getenv(const char *envname)
+{
+ static char *empty_string = "";
+ char *result = getenv(envname);
+ if (result == (char *) NULL)
+ result = empty_string;
+
+ return result;
+}
More information about the Pd-list
mailing list