[PD-cvs] pd/src s_main.c,1.7.4.17.2.22.2.23,1.7.4.17.2.22.2.24
Mathieu Bouchard
matju at users.sourceforge.net
Wed Jul 18 05:10:23 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28635
Modified Files:
Tag: desiredata
s_main.c
Log Message:
removed some MAXPDSTRING
Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.7.4.17.2.22.2.23
retrieving revision 1.7.4.17.2.22.2.24
diff -C2 -d -r1.7.4.17.2.22.2.23 -r1.7.4.17.2.22.2.24
*** s_main.c 11 Jul 2007 19:49:18 -0000 1.7.4.17.2.22.2.23
--- s_main.c 18 Jul 2007 03:10:21 -0000 1.7.4.17.2.22.2.24
***************
*** 156,167 ****
t_externalschedlibmain externalmainfunc;
HINSTANCE ntdll;
! char filename[MAXPDSTRING];
! sprintf(filename, "%s.dll", sys_externalschedlibname);
sys_bashfilename(filename, filename);
ntdll = LoadLibrary(filename);
if (!ntdll) {
post("%s: couldn't load external scheduler lib ", filename);
return 0;
}
externalmainfunc = (t_externalschedlibmain)GetProcAddress(ntdll,"main");
return((*externalmainfunc)(sys_extraflagsstring));
--- 156,169 ----
t_externalschedlibmain externalmainfunc;
HINSTANCE ntdll;
! char *filename;
! asprintf(&filename,"%s.dll", sys_externalschedlibname);
sys_bashfilename(filename, filename);
ntdll = LoadLibrary(filename);
if (!ntdll) {
post("%s: couldn't load external scheduler lib ", filename);
+ free(filename);
return 0;
}
+ free(filename);
externalmainfunc = (t_externalschedlibmain)GetProcAddress(ntdll,"main");
return((*externalmainfunc)(sys_extraflagsstring));
***************
*** 309,313 ****
void sys_findprogdir(char *progname) {
char sbuf[MAXPDSTRING], sbuf2[MAXPDSTRING];
! char *lastslash;
#ifdef UNISTD
struct stat statbuf;
--- 311,315 ----
void sys_findprogdir(char *progname) {
char sbuf[MAXPDSTRING], sbuf2[MAXPDSTRING];
! char *lastslash;
#ifdef UNISTD
struct stat statbuf;
***************
*** 326,330 ****
if (lastslash) {
/* bash last slash to zero so that sbuf is directory pd was in, e.g., ~/pd/bin */
! *lastslash = 0;
/* go back to the parent from there, e.g., ~/pd */
lastslash = strrchr(sbuf, '/');
--- 328,332 ----
if (lastslash) {
/* bash last slash to zero so that sbuf is directory pd was in, e.g., ~/pd/bin */
! *lastslash = 0;
/* go back to the parent from there, e.g., ~/pd */
lastslash = strrchr(sbuf, '/');
***************
*** 338,350 ****
/* now we believe sbuf2 holds the parent directory of the directory
pd was found in. We now want to infer the "lib" directory and the
! "gui" directory. In "simple" unix installations, the layout is
! .../bin/pd
! .../bin/pd-gui
! .../doc
! and in "complicated" unix installations, it's:
! .../bin/pd
! .../lib/pd/bin/pd-gui
! .../lib/pd/doc
! To decide which, we stat .../lib/pd; if that exists, we assume it's
the complicated layout. In MSW, it's the "simple" layout, but
the gui program is straight wish80:
--- 340,344 ----
/* now we believe sbuf2 holds the parent directory of the directory
pd was found in. We now want to infer the "lib" directory and the
! "gui" directory. To decide which, we stat .../lib/pd; if that exists, we assume it's
the complicated layout. In MSW, it's the "simple" layout, but
the gui program is straight wish80:
***************
*** 356,364 ****
sys_libdir = gensym(sbuf2);
#else
- strncpy(sbuf, sbuf2, MAXPDSTRING-30);
- sbuf[MAXPDSTRING-30] = 0;
- strcat(sbuf, "/lib/pd");
if (stat(sbuf, &statbuf) >= 0) {
! sys_libdir = gensym(sbuf);
} else {
sys_libdir = gensym(sbuf2);
--- 350,355 ----
sys_libdir = gensym(sbuf2);
#else
if (stat(sbuf, &statbuf) >= 0) {
! sys_libdir = symprintf("%s/lib/pd",sbuf2);
} else {
sys_libdir = gensym(sbuf2);
More information about the Pd-cvs
mailing list