Bug 255315

Summary: misc/vifm fix macro 'BSD' is not defined on 13.0-RELEASE
Product: Ports & Packages Reporter: Yevhenii Ftomov <ark.misc9090>
Component: Individual Port(s)Assignee: Nicola Vitale <nivit>
Status: Open ---    
Severity: Affects Some People CC: mp39590, nivit
Priority: --- Flags: mp39590: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

Description Yevhenii Ftomov 2021-04-22 02:35:38 UTC
Created attachment 224346 [details]
patch

Macro 'BSD' is required for correct package logic. In particular function 'is_dir_fast' defined in src/utils/fs.c uses this macro to select method for checking if 'path' variable is a directory. If macro is not defined then paths to executables are detected as directories. For example, executable '/usr/local/bin/feh' is reported by 'is_dir' function as directory.

This incorrect reports lead to various bugs:
1. Files with extensions can't be opened by registered programs ( defined by filextype ). Default editor (Vim) used instead.
2. During copy directory there are error messages like 'Target path specifies existing directory'
3. Files with 'sticky bit' are displayed as directories

Working solution is to add 'BSD' macro to compilation flags in package Makefile:
CFLAGS+=	-fcommon -DBSD

Thanks.