aboutsummaryrefslogtreecommitdiff
path: root/pd/src/t_tkcmd.c
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2009-01-06 19:36:42 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2009-01-06 19:36:42 +0000
commitf06fe8bef4964656f56975a97b448c1c788e7cf3 (patch)
tree553d06df3e28c41e45e2cdc2c31ff17ad7e0f303 /pd/src/t_tkcmd.c
parente60dbadb4745a209901a7ce30235e75f805ae6a0 (diff)
0.42-2 (bug fixes)
svn path=/trunk/; revision=10477
Diffstat (limited to 'pd/src/t_tkcmd.c')
-rw-r--r--pd/src/t_tkcmd.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/pd/src/t_tkcmd.c b/pd/src/t_tkcmd.c
index 6d863c15..b8cac71e 100644
--- a/pd/src/t_tkcmd.c
+++ b/pd/src/t_tkcmd.c
@@ -333,7 +333,7 @@ gotit: ;
#ifdef STARTGUI
-#define DEBUGCONNECT
+/* #define DEBUGCONNECT */
#ifdef DEBUGCONNECT
static FILE *debugfd;
@@ -621,12 +621,26 @@ int Pdtcl_Init(Tcl_Interp *interp)
int portno = 0, i;
if (argv)
{
+ /* search for arg of form "-guiport %d"; if so we're the
+ child. For some reason, the second version is too stringent
+ a test on MSW so the first, incorrect one, is conditionally
+ used. */
+#ifdef MSW
for (i = 0; i < (int)strlen(argv) - 1; i++)
if (argv[i] >= '0' && argv[i] <= '9')
{
portno = atoi(argv+i);
break;
}
+#else
+ for (i = 0; i < (int)strlen(argv) - 3; i++)
+ if (argv[i] == ' ' &&
+ argv[i+1] >= '0' && argv[i+1] <= '9')
+ {
+ portno = atoi(argv+i+1);
+ break;
+ }
+#endif
}
if (portno)
pdgui_setsock(portno);