comparison libinterp/corefcn/debug.cc @ 21628:37a44d8af461

Allow dbstop @class/method with forward slash on Windows (bug #47575). * debug.cc (get_user_code): Explicitly translate '/' to file_sep_char for '@' classes.
author Lachlan Andrew <lachlanbis@gmail.com>
date Sun, 10 Apr 2016 10:22:18 +1000
parents 555b6c78d677
children 9810e483b42f
comparison
equal deleted inserted replaced
21627:225d88a97104 21628:37a44d8af461
182 if (fname.empty ()) 182 if (fname.empty ())
183 dbg_fcn = octave_call_stack::debug_user_code (); 183 dbg_fcn = octave_call_stack::debug_user_code ();
184 else 184 else
185 { 185 {
186 std::string name = fname; 186 std::string name = fname;
187
188 if (file_ops::dir_sep_char () != '/' && name[0] == '@')
189 {
190 int len = name.length () - 1; // -1: can't have trailing '/'
191 for (int i = 2; i < len; i++) // 2: can't have @/method
192 if (name[i] == '/')
193 name[i] = file_ops::dir_sep_char ();
194 }
187 195
188 size_t name_len = name.length (); 196 size_t name_len = name.length ();
189 197
190 if (! name.empty () && name_len > 2 && name.substr (name_len-2) == ".m") 198 if (! name.empty () && name_len > 2 && name.substr (name_len-2) == ".m")
191 name = name.substr (0, name_len-2); 199 name = name.substr (0, name_len-2);