Bug #17583 2010-10-11 06:22

austin_hastings

wxFILE_SEP_PATH does not work with BeforeLast

This code, in a wizard script:

local active_file = GetEditorManager().GetActiveEditor().GetFilename();

LogDebug( _T( "active_file: " ) + active_file );

LogDebug( _T( "wxFILE_SEP_PATH: " ) + wxFILE_SEP_PATH );

local path2 = active_file.BeforeLast( '\\' );

LogDebug( _T( "path2: " ) + path2 );

local path = active_file.BeforeLast( wxFILE_SEP_PATH );

LogDebug( _T( "path: " ) + path );

Produces this output in the Debug Log:

active_file: D:\Devel\D\workspace\tsmi\tsmi\map.d

wxFILE_SEP_PATH: \

path2: D:\Devel\D\workspace\tsmi\tsmi

path: D:\Devel\D\workspace\tsmi\tsmi\map.d

If wxFILE_SEP_PATH is a character, the path and path2 values should be the same. I suspect that because it is a backslash, something is going wrong.

Category
Application::WrongBehaviour
Group
 
Status
Closed
Close date
2010-12-02 16:50
Assigned to
biplab
biplab 2010-12-02 16:50

This bug is now fixed in HEAD.

Thank you for reporting it.