/[gentoo-x86]/app-misc/mc/files/mc-4.8.2-fix-existing.patch
Gentoo

Contents of /app-misc/mc/files/mc-4.8.2-fix-existing.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Jul 21 15:59:49 2012 UTC (2 years, 5 months ago) by slyfox
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Added USE=spell to use aspell checker from live ebuild. Fix to view /var/log/*.1.gz files (https://www.midnight-commander.org/ticket/2852). Cleanup old unstable versions.

(Portage version: 2.2.0_alpha118_p1/cvs/Linux x86_64)

1 commit 2a5885fb7f5ce7af3576fa17ce697adbd9b61567
2 Author: Slava Zanko <slavazanko@gmail.com>
3 Date: Fri Mar 23 13:40:25 2012 +0300
4
5 Ticket #2761: save file on top of existing directory changes dir's permissions
6
7 Steps to reproduce:
8
9 mkdir foo
10 chmod 0700 foo
11 mcedit bar
12 ls -ld foo
13 drw-r--r-- 1 slyfox users 0 Mar 22 22:10 foo
14
15 We've lost dir's permissions.
16
17 Signed-off-by: Slava Zanko <slavazanko@gmail.com>
18
19 diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
20 index 8e6c9a9..d52e48b 100644
21 --- a/src/editor/editcmd.c
22 +++ b/src/editor/editcmd.c
23 @@ -1488,6 +1488,15 @@ edit_save_as_cmd (WEdit * edit)
24 if (vfs_path_cmp (edit->filename_vpath, exp_vpath) != 0)
25 {
26 int file;
27 + struct stat sb;
28 +
29 + if (mc_stat (exp_vpath, &sb) == 0 && !S_ISREG (sb.st_mode))
30 + {
31 + edit_error_dialog (_("Save as"),
32 + get_sys_error (_
33 + ("Cannot save: destination is not a regular file")));
34 + goto ret;
35 + }
36
37 different_filename = 1;
38 file = mc_open (exp_vpath, O_RDONLY | O_BINARY);

  ViewVC Help
Powered by ViewVC 1.1.20