Mercurial > hg > octave-lyh
diff scripts/miscellaneous/what.m @ 8877:2c8b2399247b
implement strsplit; deprecate split
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 26 Feb 2009 10:29:59 +0100 |
parents | 5dd06f19e9be |
children | eb63fbe60fab |
line wrap: on
line diff
--- a/scripts/miscellaneous/what.m +++ b/scripts/miscellaneous/what.m @@ -33,9 +33,7 @@ d = pwd (); elseif (isempty (strfind (d, filesep ()))) ## Find the appropriate directory on the path. - p = split (path (), pathsep()); - p = cellfun (@(x) deblank (x), mat2cell (p, ones (1, size (p, 1)), ... - size (p, 2)), "UniformOutput", false); + p = strtrim (strsplit (path (), pathsep())); d = p{find (cellfun (@(x) ! isempty (strfind (x, d)), p))(end)}; else [status, msg, msgid] = fileattrib (d);