changeset 32175:d8350580b981

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 03 Jul 2023 18:46:54 +0200
parents 984bca088143 (current diff) 6ad3035405a5 (diff)
children 2c9f01dc9fb5
files
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/fullfile.m	Wed Jun 28 11:11:02 2023 +0200
+++ b/scripts/miscellaneous/fullfile.m	Mon Jul 03 18:46:54 2023 +0200
@@ -61,7 +61,7 @@
 function filename = fullfile (varargin)
 
   ## remove empty arguments
-  varargin(cellfun (@isempty, varargin)) = [];
+  varargin(cellfun (@(x) isempty (x) & ! iscell (x), varargin)) = [];
 
   if (isempty (varargin))
     ## return early for all empty or no input
@@ -157,12 +157,14 @@
 %!        {["folder1", fs, "sub", fs, "f1.m"], ...
 %!         ["folder2", fs, "sub", fs, "f2.m"]});
 
+%!assert <*64377> (fullfile ("x", {}), {})
+
 ## Windows specific - drive letters and file sep type
 %!testif ; ispc ()
 %! assert (fullfile ('\/\/\//A:/\/\', "x/", "/", "/", "y", "/", "/"), ...
 %!         ['A:\' xfsyfs]);
 
-## *nix specific - double backslash
+## *nix specific - double slash
 %!testif ; ! ispc ()
 %! assert (fullfile (fs, fs), fs);