Ticket #4298 (new defect) — at Version 1

Opened 2 years ago

Last modified 2 years ago

Fix mcview for diff files on systems that have no /bin/cat (like NixOS).

Reported by: skvadrik Owned by:
Priority: major Milestone: 4.8.28
Component: mc-core Version: master
Keywords: Cc: slyfox
Blocked By: Blocking:
Branch state: merged Votes for changeset:

Description (last modified by slyfox) (diff)

TL;DR:

When opening .diff or .patch files mcview invokes /bin/cat. NixOS has no /bin/cat (the path to cat looks like /run/current-system/sw/bin/cat). However cat is still in PATH, so replace /bin/cat with just cat. This should not affect other systems as /bin should normally be in PATH.

Steps to reproduce:

  1. Create file 1.diff: echo aaa > 1.diff
  2. Try to open it with mcview: mcview 1.diff

Expected result: file is opened for viewing.
Actual result: nothing happens, the command returns error code 1.

System information:

$ uname -a
Linux skvadr 5.14.14 #1-NixOS SMP PREEMPT Wed Oct 20 09:57:59 UTC 2021 x86_64 GNU/Linux

mc information:

$ LC_MESSAGES=C mc -V
GNU Midnight Commander 4.8.27
Built with GLib 2.70.0
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
$ LC_MESSAGES=C mc -F
Home directory: /home/skvadrik
Profile root directory: /home/skvadrik

[System data]
    Config directory: /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/etc/mc/
    Data directory:   /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/share/mc/
    File extension handlers: /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/ext.d/
    VFS plugins and scripts: /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/
	extfs.d:        /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/extfs.d/
	fish:           /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/fish/

[User data]
    Config directory: /home/skvadrik/.config/mc/
    Data directory:   /home/skvadrik/.local/share/mc/
	skins:          /home/skvadrik/.local/share/mc/skins/
	extfs.d:        /home/skvadrik/.local/share/mc/extfs.d/
	fish:           /home/skvadrik/.local/share/mc/fish/
	mcedit macros:  /home/skvadrik/.local/share/mc/mc.macros
	mcedit external macros: /home/skvadrik/.local/share/mc/mcedit/macros.d/macro.*
    Cache directory:  /home/skvadrik/.cache/mc/
$ mc --configure-options
 '--disable-static' '--disable-dependency-tracking' '--prefix=/nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27' '--enable-vfs-smb' 'CC=gcc' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_PATH=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'

Change History

comment:1 Changed 2 years ago by slyfox

  • Cc slyfox added
  • Description modified (diff)
Note: See TracTickets for help on using tickets.