id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
4559	Bug with nested dirs in u7z mkdir action	ponko	andrew_b	"Current

{{{
$P7ZIP a -w""$dir"" ""$1"" ""$dir""/""$2"" ..
}}}

Should be

{{{
$P7ZIP a ""$1"" ""$dir/${2%%/*}"" ..
}}}


== Case1 ==

- open some 7z archive
- press F7
- type a/b/c, press enter
- restart mc
- open the archive
- expected: ""a"", ""a/b"", ""a/b/c"" dirs
- actual: ""c"" dir

== Case2 ==

- left panel: open some 7z archive
- right panel: create x/y/z path, copy x to the left
- restart mc
- open the archive
- expected: ""x"", ""x/y"", ""x/y/z"" dirs
- actual: ""x"", ""y"", ""z"" dirs

I could guess what one meant putting -w there, and it was completely wrong idea. -w option:

''Sets the working directory for the temporary base archive. By default, 7-Zip builds a new base archive file in the same directory as the old base archive file. By specifying this switch, you can set the working directory where the temporary base archive file will be built. After the temporary base archive file is built, it is copied over the original archive; then, the temporary file is deleted.''

By default, 7z only looks at the last part of the path. E.g. if we say ""7z a 1.7z a/b/c"", it adds the ""c"" dir. There is the ""-spf"" option (idk since which version) to make it use the whole path provided, but it means more code in our case:

cd ""$dir""
$P7ZIP a -spf ""$1"" ""$2"" ..
cd -

The one-liner `$P7ZIP a ""$1"" ""$dir/${2%%/*}"" ..` looks better."	defect	closed	major	4.8.32	mc-vfs	master	fixed					merged	committed-master
