id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
2976	Broken magic_mode in internal viewer	szaszg	andrew_b	"- create a gzipped file (e.g. gzip -c config.h >config.h.gz)
- create a gzipped file without the gz ext. (e.g. gzip -c config.h >config.h.txt)

Reproduce:
=====================
- open gzipped files in mcview (F3) - we see the ungzipped content
- switch back and fort with F8 - all O.K.

- open gzipped file with gz extension (config.h.gz) in mcview raw mode (Shift-F3) - we see the raw content
- switch back and fort with F8 - all O.K.

- open gzipped file without gz extension (config.h.txt) in mcview raw mode (Shift-F3) - we see the raw content
- press F8 (=> '''Parsed''' content) - the file name in the header is disappeared, but we see the '''raw''' content
- press F8 (=> '''Raw''' content) - the file name in the header is appeared, we see '''ungzipped''' content
- press F8 (=> '''Parsed''' content again) - nothing happend

- switch one panel to ""quick view"" mode
- highlite any of the gzipped file - we see the raw content, and there is no filename in the viewer header
- switch to QW ""panel"" and press F8 ('''Raw''' mode) - there is no filename in header and we see '''ungzipped''' content
- press F8 (=> '''Parsed''' content again) - nothing happend

Problem:
======================
magic mode broken in mcview

If we open a file with F3 from panels, then mc use ""file extension"" style open (e.g. archive.sh) and Format/Raw switching O.K.

If we open file in ""Raw"" mode, or use quick view, mc opens files without ""file extension"" helpers. Format/Raw switching broken.

In mcview.c: mcview_load we check magic_mode and detect ""compressed"" files (line 375).
If magic mode on and file is ""compressed"" we free the current vpath and generate a new vpath with ""decompress magic"", but nothing else.
So, the file name disappear and we see the raw content.
After user press F8, mcview reload the file. Now filename is the ""new"" magic filename. mcview_load open the file with the decompress ""helper"" (use sfs). We see the uncompressed (parsed) content.
After user press F8, nothing happend, because original file name lost...

Solution:
======================
I attach a patch, wich fix this problem.
The patch:
- remove the old vpath destruction
- open the file with ""uncopress magic"" if magic_mode on and file ""compressed""

This patch fix Ticket#2090 (CmdViewFile Raw/Parse switching) but '''not fix''' Ticket#2968
"	defect	closed	major	4.8.8	mcview	master	fixed		gotar@…		2090	merged	committed-master
