From: Tilghman Lesher Date: Sat, 7 Jan 2006 14:47:36 +0000 (+0000) Subject: Bug 6161 - Remove duplicated code X-Git-Tag: 1.4.0-beta1~3050 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0be002fe3bb3d4e3e786081560ab0a2fec656a96;p=thirdparty%2Fasterisk.git Bug 6161 - Remove duplicated code git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7850 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/file.c b/file.c index 41da9faf38..590fb71f0a 100644 --- a/file.c +++ b/file.c @@ -365,13 +365,9 @@ static int ast_filehelper(const char *filename, const char *filename2, const cha /* Check for a specific format */ if (ast_mutex_lock(&formatlock)) { ast_log(LOG_WARNING, "Unable to lock format list\n"); - if (action == ACTION_EXISTS) - return 0; - else - return -1; + return res; } - f = formats; - while(f) { + for (f = formats; f; f = f->next) { if (!fmt || exts_compare(f->exts, fmt)) { char *stringp=NULL; exts = ast_strdupa(f->exts); @@ -452,7 +448,6 @@ static int ast_filehelper(const char *filename, const char *filename2, const cha } while(ext); } - f = f->next; } ast_mutex_unlock(&formatlock); if ((action == ACTION_EXISTS) || (action == ACTION_OPEN))