From 50574d8c42464a7e6116f41dbe60758ccc742314 Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Fri, 23 Aug 2013 19:07:24 -0400 Subject: [PATCH] updated to reflect new sys call for parsing path --- externals/ext13/wavinfo.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/externals/ext13/wavinfo.c b/externals/ext13/wavinfo.c index 47ff9daad..d80a7c477 100644 --- a/externals/ext13/wavinfo.c +++ b/externals/ext13/wavinfo.c @@ -77,37 +77,18 @@ static void wavinfo_bang(t_wavinfo *x) // outlet_float(x->x_obj.ob_outlet, x->x_f); } -extern char * canvas_path_replace( - char const * const original, - char const * const pattern, - char const * const replacement -); - static void wavinfo_symbol(t_wavinfo *x, t_symbol *filename) { struct stat statbuf; t_wave* wavinfo; int result; - char fname[MAXPDSTRING]; - char *final_name; + char fname[FILENAME_MAX]; - //check for @sys_extra path and replace - if (strstr(filename->s_name, "@pd_extra") != NULL) { - t_namelist *path = pd_extrapath; - while (path->nl_next) - path = path->nl_next; - final_name = canvas_path_replace(filename->s_name, "@pd_extra", path->nl_string); - } - else { - final_name = filename->s_name; - } - //fprintf(stderr," %s %s\n", filename->s_name, final_name); + canvas_makefilename(x->x_canvas, filename->s_name, fname, MAXPDSTRING); + fprintf(stderr,"... %s %s\n", filename->s_name, fname); - int ok=(stat(final_name, &statbuf) >= 0); + int ok=(stat(fname, &statbuf) >= 0); if (ok>0) { - - canvas_makefilename(x->x_canvas, final_name,fname, MAXPDSTRING); - if ((x->x_fd = open(fname,( O_NONBLOCK | O_RDONLY))) < 0) { error("can't open %s",fname); -- GitLab