Wed 27 Nov 2013 10:45:54 PM UTC, original submission:
When using <Tab> to complete a directory name at the command line, the generated file separator charactor is always the UNIX character '/'. Instead, Octave (and really Readline), should append the correct filesep() character for the OS in question--in this case '\'.
Three instances of problems arising from this are detailed below. To find others, grep for comparisons to filesep in the scripts directory.
All examples assume a directory bin/ in the current directory.
The failure results from the fact that ls_command() on Windows is
and dir interprets a '/' character as an option leader.
fails because it is looking for either a bare directory name or a name with the appended filesep. The same thing exists for filedemos.
Finally:
This is super-annoying because the warning message is so unrelated to the actual problem.
One coding approach would be to fix Octave's interaction with Readline so that it returns the correct file separator.
A second approach would be to code defensively and accept either file separator '/' or '\' at the end. This would be a problem if there were actual files that used these two characters as could happen (at low probability as these are not good choices for filename characters).
|