1 |
wired 12/03/22 14:34:49 |
2 |
|
3 |
Added: mc-4.8.2-mcedit-without-file-param-fix.patch |
4 |
Log: |
5 |
fixed bug #409107 |
6 |
|
7 |
(Portage version: 2.2.0_alpha93/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-misc/mc/files/mc-4.8.2-mcedit-without-file-param-fix.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/mc/files/mc-4.8.2-mcedit-without-file-param-fix.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/mc/files/mc-4.8.2-mcedit-without-file-param-fix.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: mc-4.8.2-mcedit-without-file-param-fix.patch |
16 |
=================================================================== |
17 |
fixes mcedit not running without a file parameter |
18 |
|
19 |
https://bugs.gentoo.org/show_bug.cgi?id=409107 |
20 |
https://www.midnight-commander.org/ticket/2754 |
21 |
https://www.midnight-commander.org/changeset/529a7ba24c9da9fdb1df939ff0fe35c6d27e65df |
22 |
|
23 |
--- src/filemanager/ext.c |
24 |
+++ src/filemanager/ext.c |
25 |
@@ -637,4 +637,7 @@ |
26 |
int have_type = 0; /* Flag used by regex_check_type() */ |
27 |
|
28 |
+ if (filename_vpath == NULL) |
29 |
+ return 0; |
30 |
+ |
31 |
/* Check for the special View:%d parameter */ |
32 |
if (strncmp (action, "View:", 5) == 0) |
33 |
--- src/filemanager/midnight.c |
34 |
+++ src/filemanager/midnight.c |
35 |
@@ -952,9 +952,11 @@ |
36 |
case MC_RUN_EDITOR: |
37 |
{ |
38 |
- vfs_path_t *param_vpath; |
39 |
- |
40 |
- param_vpath = vfs_path_from_str (mc_run_param0); |
41 |
- ret = edit_file (param_vpath, mc_args__edit_start_line); |
42 |
- vfs_path_free (param_vpath); |
43 |
+ vfs_path_t *vpath = NULL; |
44 |
+ |
45 |
+ if (mc_run_param0 != NULL && *mc_run_param0 != '\0') |
46 |
+ vpath = vfs_path_from_str (mc_run_param0); |
47 |
+ |
48 |
+ ret = edit_file (vpath, mc_args__edit_start_line); |
49 |
+ vfs_path_free (vpath); |
50 |
} |
51 |
break; |
52 |
@@ -962,7 +964,9 @@ |
53 |
case MC_RUN_VIEWER: |
54 |
{ |
55 |
- vfs_path_t *vpath; |
56 |
- |
57 |
- vpath = prepend_cwd_on_local (mc_run_param0); |
58 |
+ vfs_path_t *vpath = NULL; |
59 |
+ |
60 |
+ if (mc_run_param0 != NULL && *mc_run_param0 != '\0') |
61 |
+ vpath = prepend_cwd_on_local (mc_run_param0); |
62 |
+ |
63 |
view_file (vpath, 0, 1); |
64 |
vfs_path_free (vpath); |