File: Run-in-editor-mode-when-called-as-editor.patch

package info (click to toggle)
far2l 2.7.0~beta%2Bds-1~bpo13%2B1
  • links: PTS, VCS
  • area: main
  • in suites: trixie-backports
  • size: 44,304 kB
  • sloc: cpp: 263,566; ansic: 53,886; python: 7,048; sh: 1,516; perl: 410; javascript: 279; xml: 145; makefile: 31
file content (34 lines) | stat: -rw-r--r-- 1,223 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Dmitry Shachnev <mitya57@debian.org>
Date: Tue, 28 Oct 2025 15:27:05 +0300
Subject: Run in editor mode when called as /usr/bin/editor symlink

In Debian, /usr/bin/editor is managed by alternatives system, and
I am going to register far2ledit as a possible alternative for that.

Forwarded: https://github.com/elfmz/far2l/pull/3022
---
 far2l/src/main.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/far2l/src/main.cpp b/far2l/src/main.cpp
index 4dcc5c1..2b13f64 100644
--- a/far2l/src/main.cpp
+++ b/far2l/src/main.cpp
@@ -87,7 +87,7 @@ int DirectRT = 0;
 
 static void print_help(const char *self)
 {
-	bool is_far2ledit = strstr(self, "far2ledit") != NULL;
+	bool is_far2ledit = strstr(self, "edit") != NULL;
 	printf("FAR2L Version: %s\n"
 			"FAR2L - two-panel file manager, with built-in terminal and other usefulness'es\n"
 			"Usage: %s [switches] [-cd apath [-cd ppath]]\n"
@@ -457,7 +457,7 @@ int FarAppMain(int argc, char **argv)
 	}
 
 	// run by symlink in editor mode
-	bool is_far2ledit = strstr(argv[0], "far2ledit") != NULL;
+	bool is_far2ledit = strstr(argv[0], "edit") != NULL;
 	if (is_far2ledit) {
 		Opt.OnlyEditorViewerUsed = Options::ONLY_EDITOR;
 		if (argc > 1) {