Merged revisions 76067 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Fri, 20 Jul 2007 17:11:39 +0000 (17:11 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 20 Jul 2007 17:11:39 +0000 (17:11 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r76067 | file | 2007-07-20 14:10:17 -0300 (Fri, 20 Jul 2007) | 6 lines

(closes issue #10246)
Reported by: fkasumovic
Patches:
      res_conver.patch uploaded by fkasumovic (license #101)
Use the last occurance of . to find the extension, not the first occurance.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76070 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_convert.c

index 628381a..be3d177 100644 (file)
@@ -45,7 +45,10 @@ static int split_ext(char *filename, char **name, char **ext)
 {
        *name = *ext = filename;
        
-       strsep(ext, ".");
+       if ((*ext = strrchr(filename, '.'))) {
+               **ext = '\0';
+               (*ext)++;
+       }
 
        if (ast_strlen_zero(*name) || ast_strlen_zero(*ext))
                return -1;