Mercurial > hg > octave-lyh
changeset 8634:cbd6545b0d85
fileparts.m: match all possible file separators
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 29 Jan 2009 14:52:38 -0500 |
parents | 0c5541c39a42 |
children | bef8f001032f |
files | scripts/ChangeLog scripts/miscellaneous/fileparts.m |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-01-29 John W. Eaton <jwe@octave.org> + + * miscellaneous/fileparts.m: Match all possible file separators. + 2009-01-29 Kai Habel <kai.habel@gmx.de> * plot/__go_draw_axes__.m: Add support for transparent patches.
--- a/scripts/miscellaneous/fileparts.m +++ b/scripts/miscellaneous/fileparts.m @@ -27,7 +27,10 @@ if (nargin == 1) if (ischar (filename)) - ds = rindex (filename, filesep); + ds = strchr (filename, filesep ("all"), 1, "last"); + if (isempty (ds)) + ds = 0; + endif es = rindex (filename, "."); ## These can be the same if they are both 0 (no dir or ext). if (es <= ds)