Mercurial > hg > octave-terminal
changeset 6069:67b1a61a85ce
[project @ 2006-10-21 14:33:53 by jwe]
author | jwe |
---|---|
date | Sat, 21 Oct 2006 14:33:54 +0000 |
parents | c9f0839c583f |
children | df821c22355c |
files | scripts/ChangeLog scripts/miscellaneous/copyfile.m scripts/miscellaneous/dos.m scripts/miscellaneous/movefile.m src/ChangeLog src/mex.cc src/ov-intx.h |
diffstat | 7 files changed, 46 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2006-10-20 Bill Denney <denney@seas.upenn.edu> + + * movefile.m, copyfile.m: Handle cellstr lists of files. + Quote filenames in shell commands. + 2006-10-17 David Bateman <dbateman@free.fr> * pkg/pkg.m (uninstall): Allow the uninstall to proceed even if
--- a/scripts/miscellaneous/copyfile.m +++ b/scripts/miscellaneous/copyfile.m @@ -42,7 +42,15 @@ else cmd = "/bin/cp -r"; endif - [err, msg] = system (sprintf ("%s %s %s", cmd, f1, f2)); + + ## Allow cell input and protect the file name(s). + if (iscellstr (f1)) + f1 = sprintf("\"%s\" ", f1{:}); + else + f1 = sprintf("\"%s\" ", f1); + endif + + [err, msg] = system (sprintf ("%s %s \"%s\"", cmd, f1, f2)); if (err < 0) status = false; msgid = "copyfile";
--- a/scripts/miscellaneous/dos.m +++ b/scripts/miscellaneous/dos.m @@ -20,7 +20,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {[@var{status}, @var{text}] =} dos (@var{command}) ## @deftypefnx {Function File} {[@var{status}, @var{text}] =} dos (@var{command}, "-echo") -## Execute a system command if running under a Windos-like operating +## Execute a system command if running under a Windows-like operating ## system, otherwise do nothing. Return the exit status of the program ## in @var{status} and any output sent to the standard output in ## @var{text}. If the optional second argument @code{"-echo"} is given,
--- a/scripts/miscellaneous/movefile.m +++ b/scripts/miscellaneous/movefile.m @@ -42,7 +42,15 @@ else cmd = "/bin/mv"; endif - [err, msg] = system (sprintf ("%s %s %s", cmd, f1, f2)); + + ## Allow cell input and protect the file name(s). + if (iscellstr (f1)) + f1 = sprintf("\"%s\" ", f1{:}); + else + f1 = sprintf("\"%s\" ", f1); + endif + + [err, msg] = system (sprintf ("%s %s \"%s\"", cmd, f1, f2)); if (err < 0) status = false; msgid = "movefile";
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2006-10-21 John W. Eaton <jwe@octave.org> + + * ov-intx.h + (OCTAVE_VALUE_INT_MATRIX_T::OCTAVE_TYPE_PREDICATE_FUNCTION, + (OCTAVE_VALUE_INT_SCALAR_T::OCTAVE_TYPE_PREDICATE_FUNCTION): + Function is now const, so it properly overloads method in base + class. + + * mex.cc (mxArray_octave_value::is_uint32): + Call val.is_uint32_type, not val.is_int32_type. + (mxArray_octave_value::is_uint64): + Call val.is_uint64_type, not val.is_int64_type. + (mxArray_octave_value::is_uint8): + Call val.is_uint8_type, not val.is_int8_type. + 2006-10-20 Paul Kienzle <pkienzle@users.sf.net> * ov-mex-fcn.h (octave_mex_function::atexit): New function.
--- a/src/mex.cc +++ b/src/mex.cc @@ -303,11 +303,11 @@ int is_uint16 (void) const { return val.is_uint16_type (); } - int is_uint32 (void) const { return val.is_int32_type (); } - - int is_uint64 (void) const { return val.is_int64_type (); } - - int is_uint8 (void) const { return val.is_int8_type (); } + int is_uint32 (void) const { return val.is_uint32_type (); } + + int is_uint64 (void) const { return val.is_uint64_type (); } + + int is_uint8 (void) const { return val.is_uint8_type (); } int is_range (void) const { return val.is_range (); }
--- a/src/ov-intx.h +++ b/src/ov-intx.h @@ -58,7 +58,7 @@ octave_base_value *empty_clone (void) const { return new OCTAVE_VALUE_INT_MATRIX_T (); } - bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) { return true; } + bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; } int8NDArray int8_array_value (void) const { return int8NDArray (matrix); } @@ -237,7 +237,7 @@ return retval; } - bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) { return true; } + bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; } octave_int8 int8_scalar_value (void) const { return octave_int8 (scalar); }