comparison liboctave/oct-env.cc @ 8021:85184151822e

fix typo in NPOS change
author John W. Eaton <jwe@octave.org>
date Thu, 07 Aug 2008 15:31:17 -0400
parents 0ef13e15319b
children eb63fbe60fab
comparison
equal deleted inserted replaced
8020:1d2bcc163c4d 8021:85184151822e
219 program_invocation_name = s; 219 program_invocation_name = s;
220 220
221 size_t pos 221 size_t pos
222 = program_invocation_name.find_last_of (file_ops::dir_sep_chars ()); 222 = program_invocation_name.find_last_of (file_ops::dir_sep_chars ());
223 223
224 program_name = (pos == std::string:npos) 224 program_name = (pos == std::string::npos)
225 ? program_invocation_name : program_invocation_name.substr (pos+1); 225 ? program_invocation_name : program_invocation_name.substr (pos+1);
226 } 226 }
227 227
228 // Return a pretty pathname. If the first part of the pathname is the 228 // Return a pretty pathname. If the first part of the pathname is the
229 // same as $HOME, then replace that with `~'. 229 // same as $HOME, then replace that with `~'.
303 if (! (do_absolute_pathname (s) || do_rooted_relative_pathname (s))) 303 if (! (do_absolute_pathname (s) || do_rooted_relative_pathname (s)))
304 return s; 304 return s;
305 305
306 size_t pos = s.find_last_of (file_ops::dir_sep_chars ()); 306 size_t pos = s.find_last_of (file_ops::dir_sep_chars ());
307 307
308 if (pos == std::string:npos) 308 if (pos == std::string::npos)
309 return s; 309 return s;
310 else 310 else
311 return s.substr (pos+1); 311 return s.substr (pos+1);
312 } 312 }
313 313
368 } 368 }
369 } 369 }
370 370
371 size_t tmp = s.find_first_of (file_ops::dir_sep_chars (), i); 371 size_t tmp = s.find_first_of (file_ops::dir_sep_chars (), i);
372 372
373 if (tmp == std::string:npos) 373 if (tmp == std::string::npos)
374 { 374 {
375 current_dir.append (s, i, tmp-i); 375 current_dir.append (s, i, tmp-i);
376 break; 376 break;
377 } 377 }
378 else 378 else