]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Bug fix for MixMonitor involving filenames with '.' not in the extension
authorJonathan Rose <jrose@digium.com>
Mon, 7 Mar 2011 22:02:12 +0000 (22:02 +0000)
committerJonathan Rose <jrose@digium.com>
Mon, 7 Mar 2011 22:02:12 +0000 (22:02 +0000)
Closes issue #18391)
Reported by: pabelanger
Patches:
      bugfix.patch uploaded by jrose (license 1225)
Tested by: jrose

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

apps/app_mixmonitor.c

index 706c0f3d61fd907bab0dcc9a8d190b1dbc4cd5bb..bb48ab02b2d50d5167d80154389c87a22ed84d1f 100644 (file)
@@ -244,6 +244,7 @@ static void *mixmonitor_thread(void *obj)
        struct ast_filestream **fs = NULL;
        unsigned int oflags;
        char *ext;
+       char *last_slash;
        int errflag = 0;
 
        if (option_verbose > 1)
@@ -277,7 +278,8 @@ static void *mixmonitor_thread(void *obj)
                                oflags = O_CREAT | O_WRONLY;
                                oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
 
-                               if ((ext = strrchr(mixmonitor->filename, '.')))
+                               last_slash = strrchr(mixmonitor->filename, '/');
+                               if ((ext = strrchr(mixmonitor->filename, '.')) && (ext > last_slash))
                                        *(ext++) = '\0';
                                else
                                        ext = "raw";