octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #40726] <Tab> complete uses incorrect file sep


From: Rik
Subject: [Octave-bug-tracker] [bug #40726] <Tab> complete uses incorrect file separator on Windows
Date: Wed, 27 Nov 2013 22:45:55 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0

URL:
  <http://savannah.gnu.org/bugs/?40726>

                 Summary: <Tab> complete uses incorrect file separator on
Windows
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Wed 27 Nov 2013 02:45:54 PM PST
                Category: Interpreter
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

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.


ls bin/
Invalid switch - "".
error: ls: command exited abnormally with status 127


The failure results from the fact that ls_command() on Windows is


dir /D


and dir interprets a '/' character as an option leader.


runtests dir_name/


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:


what bin/

error: what: subscript indices must be either positive integers less than 2^31
or logicals
error: called from:
error:   C:\Documents and Settings\Rik\My
Documents\Octave\octave-2013-11-27-09-34\share\octave\3.7.
7+\m\miscellaneous\what.m at line 36, column 7
e


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).





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?40726>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]