diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-01-30 15:03:20 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-01-30 15:03:20 +0000 |
commit | a8282b50e1826df08d77e3989b637814415b5865 (patch) | |
tree | 03c27ab3cc019e3323dea0a3464f071a18fa1d18 /image.c | |
parent | 3e152dc0f17e3948a6d3945f203f62060f987c17 (diff) |
Version 0.3.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@593 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'image.c')
-rwxr-xr-x | image.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -30,6 +30,7 @@ #include <asterisk/translate.h> #include <asterisk/cli.h> #include "asterisk.h" +#include "astconf.h" static struct ast_imager *list; static pthread_mutex_t listlock = AST_MUTEX_INITIALIZER; @@ -94,9 +95,9 @@ static void make_filename(char *buf, int len, char *filename, char *preflang, ch snprintf(buf, len, "%s.%s", filename, ext); } else { if (preflang && strlen(preflang)) - snprintf(buf, len, "%s/%s-%s.%s", AST_IMAGES, filename, preflang, ext); + snprintf(buf, len, "%s/%s/%s-%s.%s", ast_config_AST_VAR_DIR, "images", filename, preflang, ext); else - snprintf(buf, len, "%s/%s.%s", AST_IMAGES, filename, ext); + snprintf(buf, len, "%s/%s/%s.%s", ast_config_AST_VAR_DIR, "images", filename, ext); } } @@ -116,8 +117,10 @@ struct ast_frame *ast_read_image(char *filename, char *preflang, int format) i = list; while(!found && i) { if (i->format & format) { + char *stringp=NULL; strncpy(tmp, i->exts, sizeof(tmp)-1); - e = strtok(tmp, "|"); + stringp=tmp; + e = strsep(&stringp, "|"); while(e) { make_filename(buf, sizeof(buf), filename, preflang, e); if ((len = file_exists(buf))) { @@ -129,7 +132,7 @@ struct ast_frame *ast_read_image(char *filename, char *preflang, int format) found = i; break; } - e = strtok(NULL, "|"); + e = strsep(&stringp, "|"); } } i = i->next; |