[CHANGESET] Documentation and behavior of read_readline_init_file are incoherent

Rafael Laboissiere rafael at debian.org
Sat May 3 04:14:45 CDT 2008


The documentation of read_readline_init_file says:

 -- Built-in Function:  read_readline_init_file (FILE)
     Read the readline library initialization file FILE.  If FILE is
     omitted, read the default initialization file (normally
     `~/.inputrc').
     
However, when the following commands are issued:

octave:1> read_readline_init_file ("foo")
octave:2> read_readline_init_file ()

the second one will not read the default initialization file.  Instead, it
will reread "foo".

The very trivial changeset attached below seems to fix the problem.
However, I think that the following code in liboctave/oct-rl-edit.c:

   else
     rl_re_read_init_file (0, 0);

will never be executed.  The reason for that is because 

    read_readline_init_file ()

has exactly the same behavior as

    read_readline_init_file ("")

I did not investigate very thoroughly, but I think that the default argument
in:

    command_editor::read_init_file (const std::string& file = std::string ());

is responsible for that.

-- 
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: really-read-inputrc.patch
Type: text/x-diff
Size: 1208 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080503/f284a1a6/attachment.bin 


More information about the Bug-octave mailing list