@@ -2254,22 +2254,6 @@ uae_u8* target_load_keyfile(uae_prefs* p, const char* path, int* sizep, char* na
22542254 return nullptr ;
22552255}
22562256
2257- std::vector<std::string> split_command (const std::string& command)
2258- {
2259- std::vector<std::string> word_vector;
2260- std::size_t prev = 0 , pos;
2261- while ((pos = command.find_first_of (' ' , prev)) != std::string::npos)
2262- {
2263- if (pos > prev)
2264- word_vector.push_back (command.substr (prev, pos - prev));
2265- prev = pos + 1 ;
2266- }
2267- if (prev < command.length ())
2268- word_vector.push_back (command.substr (prev, std::string::npos));
2269-
2270- return word_vector;
2271- }
2272-
22732257void replace (std::string& str, const std::string& from, const std::string& to)
22742258{
22752259 const auto start_pos = str.find (from);
@@ -2285,45 +2269,13 @@ void target_execute(const char* command)
22852269 mouseactive = 0 ;
22862270
22872271 write_log (" Target_execute received: %s\n " , command);
2288- const std::string command_string = command;
2289- auto command_parts = split_command (command_string);
2290-
2291- for (size_t i = 0 ; i < command_parts.size (); ++i)
2292- {
2293- if (i > 0 )
2294- {
2295- const auto delimiter_position = command_parts[i].find (' :' );
2296- if (delimiter_position != std::string::npos)
2297- {
2298- auto volume_or_device_name = command_parts[i].substr (0 , delimiter_position);
2299- for (auto mount = 0 ; mount < currprefs.mountitems ; mount++)
2300- {
2301- if (currprefs.mountconfig [mount].ci .type == UAEDEV_DIR)
2302- {
2303- if (_tcsicmp (currprefs.mountconfig [mount].ci .volname , volume_or_device_name.c_str ()) == 0
2304- || _tcsicmp (currprefs.mountconfig [mount].ci .devname , volume_or_device_name.c_str ()) == 0 )
2305- {
2306- std::string root_directory = currprefs.mountconfig [mount].ci .rootdir ;
2307- volume_or_device_name += ' :' ;
2308- replace (command_parts[i], volume_or_device_name, root_directory);
2309- }
2310- }
2311- }
2312- }
2313- }
2314- }
2315-
2316- std::ostringstream command_stream;
2317- for (const auto & part : command_parts)
2318- {
2319- command_stream << part << " " ;
2320- }
2321- // Ensure this runs in the background, otherwise we'll block the emulator until it returns
2322- command_stream << " &" ;
2272+
2273+ std::string final_command = command;
2274+ // Ensure this runs in the background
2275+ final_command += " &" ;
23232276
23242277 try
23252278 {
2326- std::string final_command = command_stream.str ();
23272279 write_log (" Executing: %s\n " , final_command.c_str ());
23282280 system (final_command.c_str ());
23292281 }
0 commit comments