# HG changeset patch # User jwe # Date 1137182469 0 # Node ID 83df01a26136e12a5dbee107dfd5336527cdf799 # Parent f2c058edda4064f47b854d51d335efc9b2875e52 [project @ 2006-01-13 20:01:08 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2006-01-13 Bill Denney + + * miscellaneous/dir.m: Use filesep instead of "/" where needed. + * miscellaneous/fullfile.m: Likewise. + 2006-01-12 David Bateman * general/blkdiag.m: Compatible behavior for empty matrices diff --git a/scripts/miscellaneous/dir.m b/scripts/miscellaneous/dir.m --- a/scripts/miscellaneous/dir.m +++ b/scripts/miscellaneous/dir.m @@ -81,7 +81,7 @@ tfn = lst{j}; ## The lstat call seems to be the bottleneck for large ## directories. - [st, err, msg] = lstat (strcat (fn, "/", tfn)); + [st, err, msg] = lstat (strcat (fn, filesep, tfn)); if (err < 0) warning ("dir: stat failed for %s (%s)", tfn, msg); else diff --git a/scripts/miscellaneous/fullfile.m b/scripts/miscellaneous/fullfile.m --- a/scripts/miscellaneous/fullfile.m +++ b/scripts/miscellaneous/fullfile.m @@ -29,15 +29,15 @@ if (length (filename) < 1) filename = "."; endif - if (strcmp (filename(end), "/")) + if (strcmp (filename(end), filesep)) filename(end) = ""; endif for i = 2:nargin tmp = varargin{i}; - if (strcmp (tmp(1), "/")) + if (strcmp (tmp(1), filesep)) tmp(1) = ""; endif - if (i < nargin && strcmp (tmp(end), "/")) + if (i < nargin && strcmp (tmp(end), filesep)) tmp(end) = ""; endif filename = strcat (filename, filesep, tmp); diff --git a/test/ChangeLog b/test/ChangeLog --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2006-01-13 Bill Denney + + * test_system.m: Use filesep instead of "/" where needed. + 2005-12-14 David Bateman * build_sparse_tests.sh: New script to build sparse matrix tests. diff --git a/test/test_system.m b/test/test_system.m --- a/test/test_system.m +++ b/test/test_system.m @@ -217,7 +217,7 @@ %% test/octave.test/system/readdir-1.m %!test -%! [files, status, msg] = readdir ("/"); +%! [files, status, msg] = readdir (filesep); %! assert(iscell (files) && status == 0 && msg == ""); %% test/octave.test/system/readdir-2.m @@ -274,7 +274,7 @@ %% test/octave.test/system/stat-1.m %!test -%! [s, err, msg] = stat ("/"); +%! [s, err, msg] = stat (filesep); %! assert((err == 0 %! && isstruct (s) %! && struct_contains (s, "dev") @@ -297,7 +297,7 @@ %% test/octave.test/system/lstat-1.m %!test -%! [s, err, msg] = lstat ("/"); +%! [s, err, msg] = lstat (filesep); %! assert((err == 0 %! && isstruct (s) %! && struct_contains (s, "dev") @@ -319,7 +319,7 @@ %!error <... lstat:.*> lstat ("foo", 1); %% test/octave.test/system/glob-1.m -%!assert(iscell (glob ("/*"))); +%!assert(iscell (glob ([filesep "*"]))); %% test/octave.test/system/glob-2.m %!error <... glob:*> glob ();