comparison src/oct-hist.cc @ 3544:71bd2d124119

[project @ 2000-02-02 21:02:31 by jwe]
author jwe
date Wed, 02 Feb 2000 21:02:41 +0000
parents e8fbc8c3d6d9
children 4833e231e05b
comparison
equal deleted inserted replaced
3543:c5b996022ef7 3544:71bd2d124119
112 112
113 std::string env_file = octave_env::getenv ("OCTAVE_HISTFILE"); 113 std::string env_file = octave_env::getenv ("OCTAVE_HISTFILE");
114 114
115 if (! env_file.empty ()) 115 if (! env_file.empty ())
116 { 116 {
117 fstream f (env_file.c_str (), (ios::in | ios::out)); 117 fstream f (env_file.c_str (), (std::ios::in | std::ios::out));
118 118
119 if (f) 119 if (f)
120 { 120 {
121 file = env_file; 121 file = env_file;
122 f.close (); 122 f.close ();
403 reverse = 1; 403 reverse = 1;
404 } 404 }
405 405
406 std::string name = file_ops::tempnam ("", "oct-"); 406 std::string name = file_ops::tempnam ("", "oct-");
407 407
408 fstream file (name.c_str (), ios::out); 408 fstream file (name.c_str (), std::ios::out);
409 409
410 if (! file) 410 if (! file)
411 { 411 {
412 error ("%s: couldn't open temporary file `%s'", warn_for, 412 error ("%s: couldn't open temporary file `%s'", warn_for,
413 name.c_str ()); 413 name.c_str ());
455 octave_set_interrupt_handler (old_interrupt_handler); 455 octave_set_interrupt_handler (old_interrupt_handler);
456 456
457 // Write the commands to the history file since parse_and_execute 457 // Write the commands to the history file since parse_and_execute
458 // disables command line history while it executes. 458 // disables command line history while it executes.
459 459
460 fstream file (name.c_str (), ios::in); 460 fstream file (name.c_str (), std::ios::in);
461 461
462 char *line; 462 char *line;
463 int first = 1; 463 int first = 1;
464 while ((line = edit_history_readline (file)) != 0) 464 while ((line = edit_history_readline (file)) != 0)
465 { 465 {