Mercurial > hg > octave-terminal
changeset 14037:4228c102eca9 stable
maint: merge default to stable to pull change for bug #35038
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 12 Dec 2011 16:04:51 -0800 |
parents | 3889c3eecaf0 (current diff) 29e9eb59f917 (diff) |
children | b0cdd60db5e5 |
files | |
diffstat | 1 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/ls_command.m +++ b/scripts/miscellaneous/ls_command.m @@ -30,10 +30,10 @@ global __ls_command__; if (isempty (__ls_command__)) - ## FIXME -- ispc and isunix both return true for Cygwin. Should they? + ## MinGW uses different ls_command if (ispc () && ! isunix () && isempty (file_in_path (getenv ("PATH"), "ls"))) - __ls_command__ = "cmd /C dir /D"; + __ls_command__ = "dir /D"; else __ls_command__ = "ls -C"; endif @@ -54,3 +54,14 @@ endif endfunction + + +%!test +%! cmd = ls_command (); +%! assert (ischar (cmd)); +%! if (ispc () && ! isunix ()) +%! assert (cmd(1:3), "dir"); +%! else +%! assert (cmd(1:2), "ls"); +%! endif +