From: Zack Middleton Date: Tue, 23 Jul 2019 20:32:47 +0000 (-0500) Subject: radiant: fix command-line error message for non-map filename X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9d15e09a661e66587903a68304e5df65dd1f4ca3;p=xonotic%2Fnetradiant.git radiant: fix command-line error message for non-map filename mapname wasn't set so "(null)" was printed. Fixes 6ba43753 ("radiant: fix command-line opening on windows"). --- diff --git a/radiant/main.cpp b/radiant/main.cpp index 172c3fa9..27d9b8af 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -537,9 +537,9 @@ int main( int argc, char* argv[] ){ // Gtk already removed parsed `--options` if ( argc == 2 ) { if ( strlen( argv[ 1 ] ) > 1 ) { - if ( g_str_has_suffix( argv[ 1 ], ".map" ) ) { - mapname = argv[ 1 ]; + mapname = argv[ 1 ]; + if ( g_str_has_suffix( mapname, ".map" ) ) { if ( !g_path_is_absolute( mapname ) ) { mapname = g_build_filename( g_get_current_dir(), mapname, NULL ); } @@ -551,6 +551,7 @@ int main( int argc, char* argv[] ){ } else { g_print( "bad file name, will not load: %s\n", mapname ); + mapname = NULL; } } }