comparison scripts/miscellaneous/unpack.m @ 31193:6bcc5e6d77fe stable

unpack.m: Escape backslashes in paths on Windows (bug #62888). * scripts/miscalleneous/unpack.m: Escape backslashes in paths on Windows. That seems to be necessary to correctly handle double backslashes that prefix UNC paths.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 18 Aug 2022 08:40:57 +0200
parents 796f54d4ddbf
children c8ad083a5802
comparison
equal deleted inserted replaced
31191:bb9d776eafac 31193:6bcc5e6d77fe
269 ## Save and restore the TAR_OPTIONS environment variable used by GNU tar. 269 ## Save and restore the TAR_OPTIONS environment variable used by GNU tar.
270 tar_options_env = getenv ("TAR_OPTIONS"); 270 tar_options_env = getenv ("TAR_OPTIONS");
271 unwind_protect 271 unwind_protect
272 unsetenv ("TAR_OPTIONS"); 272 unsetenv ("TAR_OPTIONS");
273 cd (dir); 273 cd (dir);
274 if (ispc ())
275 ## Escape backslashes (necessary for UNC paths).
276 file = strrep (file, '\', '\\');
277 endif
274 [status, output] = system (sprintf ([command " 2>&1"], file)); 278 [status, output] = system (sprintf ([command " 2>&1"], file));
275 unwind_protect_cleanup 279 unwind_protect_cleanup
276 cd (origdir); 280 cd (origdir);
277 if (! isempty (tar_options_env)) 281 if (! isempty (tar_options_env))
278 setenv ("TAR_OPTIONS", tar_options_env); 282 setenv ("TAR_OPTIONS", tar_options_env);