Mercurial > octave-antonio
diff scripts/miscellaneous/tar.m @ 19927:0cc365dada52
Allow tar, unpack, and zip to run on Windows with CR/NL EOL.
* tar.m: Don't check for "\n" newline. Use ostrsplit with "\r\n" to split on
any EOL char. Use unlink in BIST test, rather than delete, because it will not
generate an error.
* unpack.m: Don't check for "\n" newline. Use ostrsplit with "\r\n" to split on
any EOL char.
* zip.m: Don't check for "\n" newline. Use ostrsplit with "\r\n" to split on
any EOL char. Use unlink in BIST test, rather than delete, because it will not
generate an error.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 10 Mar 2015 21:23:54 -0700 |
parents | ee7159d9a330 |
children | 8c20fb6caa16 |
line wrap: on
line diff
--- a/scripts/miscellaneous/tar.m Tue Mar 10 20:37:37 2015 -0700 +++ b/scripts/miscellaneous/tar.m Tue Mar 10 21:23:54 2015 -0700 @@ -65,10 +65,7 @@ endif if (nargout > 0) - if (output(end) == "\n") - output(end) = []; - endif - filelist = ostrsplit (output, "\n"); + filelist = ostrsplit (output, "\r\n", true); filelist = filelist'; endif @@ -117,9 +114,7 @@ %! assert (str, "Goodbye World"); %! unwind_protect_cleanup %! chdir (orig_dir); -%! if (exist (tarname)) -%! delete (tarname); -%! endif +%! unlink (tarname); %! confirm_recursive_rmdir (false, "local"); %! if (exist (dirname)) %! rmdir (dirname, "s");