summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/pdbox-func.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pdbox/pdbox-func.c')
-rw-r--r--apps/plugins/pdbox/pdbox-func.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/apps/plugins/pdbox/pdbox-func.c b/apps/plugins/pdbox/pdbox-func.c
index d6a2ea750a..c5e81ed7b9 100644
--- a/apps/plugins/pdbox/pdbox-func.c
+++ b/apps/plugins/pdbox/pdbox-func.c
@@ -2319,12 +2319,12 @@ void glob_evalfile(t_pd *ignore, t_symbol *name, t_symbol *dir);
2319void openit(const char *dirname, const char *filename) 2319void openit(const char *dirname, const char *filename)
2320{ 2320{
2321 char* nameptr; 2321 char* nameptr;
2322 char* dirbuf = getbytes(MAXPDSTRING); 2322 char dirbuf[MAXPDSTRING];
2323 2323
2324 /* Workaround: If the file resides in the root directory, 2324 /* Workaround: If the file resides in the root directory,
2325 add a trailing slash to prevent directory part 2325 add a trailing slash to prevent directory part
2326 of the filename from being removed -- W.B. */ 2326 of the filename from being removed -- W.B. */
2327 char* ffilename = getbytes(MAXPDSTRING); 2327 char ffilename[MAXPDSTRING];
2328 ffilename[0] = '/'; 2328 ffilename[0] = '/';
2329 ffilename[1] = '\0'; 2329 ffilename[1] = '\0';
2330 strcat(ffilename, filename); 2330 strcat(ffilename, filename);
@@ -2338,10 +2338,6 @@ void openit(const char *dirname, const char *filename)
2338 } 2338 }
2339 else 2339 else
2340 error("%s: can't open", filename); 2340 error("%s: can't open", filename);
2341
2342 /* Clean up. */
2343 freebytes(dirbuf, MAXPDSTRING);
2344 freebytes(ffilename, MAXPDSTRING);
2345} 2341}
2346 2342
2347 2343
@@ -2374,14 +2370,14 @@ char* rb_getcwd(char* buf, ssize_t size)
2374extern t_namelist* sys_openlist; 2370extern t_namelist* sys_openlist;
2375void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv) 2371void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv)
2376{ 2372{
2373 t_namelist *nl;
2374 char cwd[MAXPDSTRING];
2375
2377 (void) dummy; 2376 (void) dummy;
2378 (void) s; 2377 (void) s;
2379 (void) argc; 2378 (void) argc;
2380 (void) argv; 2379 (void) argv;
2381 2380
2382 t_namelist *nl;
2383 char* cwd = getbytes(MAXPDSTRING);
2384
2385 /* Get current working directory. */ 2381 /* Get current working directory. */
2386 rb_getcwd(cwd, MAXPDSTRING); 2382 rb_getcwd(cwd, MAXPDSTRING);
2387 2383
@@ -2391,9 +2387,6 @@ void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv)
2391 2387
2392 namelist_free(sys_openlist); 2388 namelist_free(sys_openlist);
2393 sys_openlist = 0; 2389 sys_openlist = 0;
2394
2395 /* Clean up. */
2396 freebytes(cwd, MAXPDSTRING);
2397} 2390}
2398 2391
2399/* Fake GUI start. Originally in s_inter.c */ 2392/* Fake GUI start. Originally in s_inter.c */
@@ -2405,7 +2398,7 @@ int sys_startgui(const char *guidir)
2405{ 2398{
2406 unsigned int i; 2399 unsigned int i;
2407 t_atom zz[23]; 2400 t_atom zz[23];
2408 char* cmdbuf = getbytes(4*MAXPDSTRING); 2401 char cmdbuf[4*MAXPDSTRING];
2409 2402
2410 (void) guidir; 2403 (void) guidir;
2411 2404
@@ -2420,9 +2413,6 @@ int sys_startgui(const char *guidir)
2420 SETFLOAT(zz+22,0); 2413 SETFLOAT(zz+22,0);
2421 glob_initfromgui(0, 0, 23, zz); 2414 glob_initfromgui(0, 0, 23, zz);
2422 2415
2423 /* Clean up. */
2424 freebytes(cmdbuf, 4*MAXPDSTRING);
2425
2426 return 0; 2416 return 0;
2427} 2417}
2428 2418
@@ -2436,14 +2426,11 @@ int sys_getblksize(void)
2436/* Find library directory and set it. */ 2426/* Find library directory and set it. */
2437void sys_findlibdir(const char* filename) 2427void sys_findlibdir(const char* filename)
2438{ 2428{
2439 (void) filename; 2429 char sbuf[MAXPDSTRING];
2440 2430
2441 char* sbuf = getbytes(MAXPDSTRING); 2431 (void) filename;
2442 2432
2443 /* Make current working directory the system library directory. */ 2433 /* Make current working directory the system library directory. */
2444 rb_getcwd(sbuf, MAXPDSTRING); 2434 rb_getcwd(sbuf, MAXPDSTRING);
2445 sys_libdir = gensym(sbuf); 2435 sys_libdir = gensym(sbuf);
2446
2447 /* Clean up. */
2448 freebytes(sbuf, MAXPDSTRING);
2449} 2436}