VirtualBox

Changes between Initial Version and Version 1 of Ticket #18513, comment 2


Ignore:
Timestamp:
Mar 21, 2019 11:04:00 PM (6 years ago)
Author:
cleanner

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18513, comment 2

    initial v1  
    44As I mentioned above, a solution of this bug is to modify the line 950 to "char *pszSuff    = NULL;".
    55
    6 However, it's still not perfect, because I found that if the video recording path is "C:\abc.def"(modified by user), it will still work incorrectly, becasue the final path is "C:\abc.webm" but not "C:\abc.def.webm", which including the VM full name "abc.def".
     6However, it's still not perfect, because I found that if the video recording path is "'''C:\abc.def'''"(manually modified by user), it will still work incorrectly, it leads to a final path "'''C:\abc.webm'''" but not "'''C:\abc.def.webm'''", which including the VM full name "'''abc.def'''".
    77
    88I think the main reason is the line 947.
    99
    10 It tries to remove something from the video recording path input by user.
     10It tries to '''remove''' the suffix from the video recording path unconditionally.
    1111
    12 Why not try to add the suffix to the path?
    1312
    14 That means we just judge whether the path specified by user includes the ".webm" suffix, if not yet, we add the suffix to the path, if it has included the suffix already, just let it go.
     13So let's just try the code below:
    1514
    16 Sorry, I am a lazy guy, so just please fix the bug by yourself, because I am going to fly several hours later.Ha Ha Ha Ha.....
     15------------------------------------------------------------------------------------
     16
     17944    char *pszAbsPath = RTPathAbsDup(com::Utf8Str(pCfg->File.strName).c_str());[[BR]]
     18
     19945    AssertPtrReturn(pszAbsPath, VERR_NO_MEMORY);[[BR]]
     20
     21
     22947    '''if (_stricmp(RTPathSuffix(pszAbsPath), ".webm") == 0)'''[[BR]]
     23
     24948    {[[BR]]
     25
     26949        '''RTPathStripSuffix(pszAbsPath);'''[[BR]]
     27
     28950    }[[BR]]
     29
     30
     31952    AssertPtrReturn(pszAbsPath, VERR_INVALID_PARAMETER);[[BR]]
     32
     33
     34953    '''char *pszSuff    = RTStrDup(".webm");'''[[BR]]
     35
     36
     37955    if (!pszSuff)[[BR]]
     38
     39956    {[[BR]]
     40
     41957        RTStrFree(pszAbsPath);[[BR]]
     42
     43958        return VERR_NO_MEMORY;[[BR]]
     44
     45959    }[[BR]]
     46
     47
     48------------------------------------------------------------------------------------
     49
     50Thanks!
    1751
    1852Replying to [ticket:18513 cleanner]:

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette