comparison scripts/miscellaneous/private/__xzip__.m @ 21525:50255c612915

Fix zip, gzip, bzip2 to allow names with spaces (bug #47232). * zip.m: Expand out wildcards with glob(), escape double quotes with regexprep, and then wrap file names in double quotes before passing to zip command via the shell. * __xzip__.m: Wrap file names in double quotes before passing through shell.
author Rik <rik@octave.org>
date Tue, 22 Mar 2016 14:25:35 -0700
parents 516bb87ea72e
children 3d60ed163b70
comparison
equal deleted inserted replaced
21524:aac8b2ca9280 21525:50255c612915
68 68
69 fnames = fname_only (files); 69 fnames = fname_only (files);
70 70
71 cd (outdir); 71 cd (outdir);
72 72
73 cmd = sprintf (commandtemplate, sprintf (" %s", fnames{:})); 73 cmd = sprintf (commandtemplate, sprintf (' "%s"', fnames{:}));
74 74
75 [status, output] = system (cmd); 75 [status, output] = system (cmd);
76 if (status) 76 if (status)
77 fcn = evalin ("caller", "mfilename ()"); 77 fcn = evalin ("caller", "mfilename ()");
78 error ("%s: %s command failed with exit status = %d", 78 error ("%s: %s command failed with exit status = %d",