From: Jason Parker Date: Thu, 10 Apr 2008 17:26:10 +0000 (+0000) Subject: Only try to prefix language if we are not using an absolute path (suffix it otherwise). X-Git-Tag: 1.4.20-rc1~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d08d42e0e4c0378ed9dde730dde983106bac7ec;p=thirdparty%2Fasterisk.git Only try to prefix language if we are not using an absolute path (suffix it otherwise). en/var/lib/asterisk/sounds/blah.gsm is a very silly path. (closes issue #12379) Reported by: kuj Patches: 12379-absolutepath.diff uploaded by qwell (license 4) Tested by: kuj, qwell git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114035 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/file.c b/main/file.c index 842c4a6988..c44941b2ba 100644 --- a/main/file.c +++ b/main/file.c @@ -487,7 +487,7 @@ static int fileexists_test(const char *filename, const char *fmt, const char *la return -1; } - if (ast_language_is_prefix) { /* new layout */ + if (ast_language_is_prefix && !is_absolute_path(filename)) { /* new layout */ if (lang) { snprintf(buf, buflen, "%s/%s", lang, filename); } else { @@ -527,11 +527,6 @@ static int fileexists_core(const char *filename, const char *fmt, const char *pr return -1; } - if (is_absolute_path(filename)) { - ast_copy_string(buf, filename, buflen); - return ast_filehelper(buf, NULL, fmt, ACTION_EXISTS); - } - /* We try languages in the following order: * preflang (may include dialect) * lang (preflang without dialect - if any)