* fix backslashes in opened by cmd line map path = fix duplicates in recent maps list

This commit is contained in:
Garux 2018-04-21 23:26:40 +03:00
parent 460df292ff
commit 16c00ac54c
3 changed files with 9 additions and 10 deletions

View File

@ -180,17 +180,16 @@ bool portable_app_setup(){
}
const char* g_openCmdMap;
CopiedString g_openMapByCmd;
void cmdMap(){
g_openCmdMap = NULL;
for ( int i = 1; i < g_argc; ++i )
{
//if ( !stricmp( g_argv[i] + strlen(g_argv[i]) - 4, ".map" ) ){
if( string_equal_suffix_nocase( g_argv[i], ".map" ) ){
g_openCmdMap = g_argv[i];
StringOutputStream stream( 256 );
stream << PathCleaned( g_argv[i] );
g_openMapByCmd = stream.c_str();
return;
}
}
}
#if defined( POSIX )

View File

@ -29,7 +29,7 @@ const char* environment_get_app_path();
extern int g_argc;
extern const char** g_argv;
extern const char* g_openCmdMap;
#include "string/stringfwd.h"
extern CopiedString g_openMapByCmd;
#endif

View File

@ -654,8 +654,8 @@ int main( int argc, char* argv[] ){
hide_splash();
if( g_openCmdMap && *g_openCmdMap ){
Map_LoadFile( g_openCmdMap );
if( !g_openMapByCmd.empty() ){
Map_LoadFile( g_openMapByCmd.c_str() );
}
else if ( g_bLoadLastMap && !g_strLastMap.empty() ) {
Map_LoadFile( g_strLastMap.c_str() );