changeset 27045:2faa56886789

maint: merge stable to default.
author Rik <rik@octave.org>
date Thu, 11 Apr 2019 08:52:06 -0700
parents 43f6f02dd91c (current diff) 6caf75200854 (diff)
children 7f605f88d1e3
files libgui/src/main-window.cc libinterp/corefcn/syscalls.cc
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Wed Apr 10 23:53:01 2019 +0200
+++ b/libgui/src/main-window.cc	Thu Apr 11 08:52:06 2019 -0700
@@ -497,6 +497,9 @@
     // Close the file if opened
 #if defined (HAVE_QSCINTILLA)
     m_editor_window->handle_file_remove (o, n);
+#else
+    octave_unused_parameter (o);
+    octave_unused_parameter (n);
 #endif
 
     // We are done: Unlock and wake the worker thread
--- a/libinterp/corefcn/syscalls.cc	Wed Apr 10 23:53:01 2019 +0200
+++ b/libinterp/corefcn/syscalls.cc	Thu Apr 11 08:52:06 2019 -0700
@@ -1097,6 +1097,25 @@
   return ovl (status, msg);
 }
 
+/*
+%!test
+%! file = tempname ();
+%! fid = fopen (file, "wt");
+%! if (fid < 0)
+%!   error ("Could not open temporary file for unlink BIST test");
+%! endif
+%! fdisp (fid, pi);
+%! fclose (fid);
+%! [err, msg] = unlink (file);
+%! assert (err, 0);
+%! assert (msg, "");
+
+## Test input validation
+%!error unlink ()
+%!error unlink ("a", "b")
+%!error <FILE must be a string> unlink (123)
+*/
+
 DEFUNX ("waitpid", Fwaitpid, args, ,
         doc: /* -*- texinfo -*-
 @deftypefn {} {[@var{pid}, @var{status}, @var{msg}] =} waitpid (@var{pid}, @var{options})