Ticket #82: savannah: "save as" retains mode (take 2) provided by dborka
commitc769f7fcd3b9aee910a7d3027d677621635faeb2
authorSergei Trofimovich <slyfox@inbox.ru>
Tue, 18 Aug 2009 19:28:59 +0000 (18 22:28 +0300)
committerSergei Trofimovich <slyfox@inbox.ru>
Tue, 18 Aug 2009 19:28:59 +0000 (18 22:28 +0300)
tree3e16870b50ea580e596257e8850fcb0f5bdace0c
parent65771004c4948dd664674e8dee2ddce11786d777
Ticket #82: savannah: "save as" retains mode (take 2) provided by dborka

Suppose you have two files, foo and bar. Both files have 444 permissions.
Now edit foo and "Save". It can't save and instead prompt you to "Save As".
Enter bar. It will chmod bar to 644. If we don't touch touch existing file
permissions for "Save", I don't see why we should for "Save As".

Patch adds S_IWUSR only if different_filename and file does not exist yet.
For consistency, it's S_IWUSR not S_IWRITE.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
edit/editcmd.c