Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21718
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.24 retrieving revision 1.7.4.17.2.22.2.25 diff -C2 -d -r1.7.4.17.2.22.2.24 -r1.7.4.17.2.22.2.25 *** s_main.c 18 Jul 2007 03:10:21 -0000 1.7.4.17.2.22.2.24 --- s_main.c 18 Jul 2007 04:18:38 -0000 1.7.4.17.2.22.2.25 *************** *** 317,323 **** /* find out by what string Pd was invoked; put answer in "sbuf". */ #ifdef MSW ! GetModuleFileName(NULL, sbuf2, sizeof(sbuf2)); ! sbuf2[MAXPDSTRING-1] = 0; ! sys_unbashfilename(sbuf2, sbuf); #endif /* MSW */ #ifdef UNISTD --- 317,323 ---- /* find out by what string Pd was invoked; put answer in "sbuf". */ #ifdef MSW ! GetModuleFileName(NULL, sbuf, sizeof(sbuf2)); ! sbuf[MAXPDSTRING-1] = 0; ! sys_unbashfilename(sbuf,sbuf); #endif /* MSW */ #ifdef UNISTD *************** *** 338,358 **** strcpy(sbuf2, INSTALL_PREFIX); } - /* 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: - .../bin/pd - .../bin/wish80.exe - .../doc - */ #ifdef MSW sys_libdir = gensym(sbuf2); #else ! if (stat(sbuf, &statbuf) >= 0) { ! sys_libdir = symprintf("%s/lib/pd",sbuf2); ! } else { ! sys_libdir = gensym(sbuf2); ! } #endif } --- 338,345 ---- strcpy(sbuf2, INSTALL_PREFIX); } #ifdef MSW sys_libdir = gensym(sbuf2); #else ! sys_libdir = stat(sbuf, &statbuf)>=0 ? symprintf("%s/lib/pd",sbuf2) : gensym(sbuf2); #endif } *************** *** 603,607 **** from command-line arguments */ static void sys_afterargparse() { ! char sbuf[MAXPDSTRING]; t_audiodevs audio_in, audio_out; int nchindev, nchoutdev, rate, dacblksize, advance, scheduler; --- 590,594 ---- from command-line arguments */ static void sys_afterargparse() { ! char *sbuf; t_audiodevs audio_in, audio_out; int nchindev, nchoutdev, rate, dacblksize, advance, scheduler; *************** *** 609,625 **** int nmidioutdev = 0, midioutdev[MAXMIDIOUTDEV]; /* add "extra" library to path */ ! strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30); ! sbuf[MAXPDSTRING-30] = 0; ! strcat(sbuf, "/extra"); sys_setextrapath(sbuf); ! /* add "doc/5.reference" library to helppath */ ! strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30); ! sbuf[MAXPDSTRING-30] = 0; ! strcat(sbuf, "/doc/5.reference"); sys_helppath = namelist_append_files(sys_helppath, sbuf); ! /* correct to make audio and MIDI device lists zero based. On ! MMIO, however, "1" really means the second device (the first one ! is "mapper" which is was not included when the command args were ! set up, so we leave it that way for compatibility. */ if (!sys_mmio) { for (int i=0; i<sys_nsoundin ; i++) sys_soundindevlist[i]--; --- 596,607 ---- int nmidioutdev = 0, midioutdev[MAXMIDIOUTDEV]; /* add "extra" library to path */ ! asprintf(&sbuf,"%s/extra",sys_libdir->name); sys_setextrapath(sbuf); ! free(sbuf); ! asprintf(&sbuf,"%s/doc/5.reference",sys_libdir->name); sys_helppath = namelist_append_files(sys_helppath, sbuf); ! free(sbuf); ! /* correct to make audio and MIDI device lists zero based. On MMIO, however, "1" really means the second device ! the first one is "mapper" which is was not included when the command args were set up, so we leave it that way for compatibility. */ if (!sys_mmio) { for (int i=0; i<sys_nsoundin ; i++) sys_soundindevlist[i]--;