changeset 16711:6b00c6bff60c

ls.m: fix error when listing an empty directory * ls.m: Fix error when listing an empty directory when called with an output argument.
author Mike Miller <mtmiller@ieee.org>
date Fri, 31 May 2013 19:00:08 -0400
parents 00db1d7312bb
children 9ce08a1efc29
files scripts/miscellaneous/ls.m
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/ls.m	Fri May 31 12:06:32 2013 -0700
+++ b/scripts/miscellaneous/ls.m	Fri May 31 19:00:08 2013 -0400
@@ -72,6 +72,8 @@
       error ("ls: command exited abnormally with status %d\n", status);
     elseif (nargout == 0)
       puts (output);
+    elseif (isempty (output))
+      retval = "";
     else
       retval = strvcat (regexp (output, '\S+', 'match'){:});
     endif