Fix an issue in IDM_EDIT_CLEARREADONLY
Using ^= for the readonly attribute will cause it to always change the bit. So if CLEARREADONLY is called on a file that isn't read only, the file will become read only. Fix #5768, close #5774pull/5972/head
parent
6d3606074a
commit
fa254e579c
|
@ -1568,7 +1568,7 @@ void Notepad_plus::command(int id)
|
||||||
Buffer * buf = _pEditView->getCurrentBuffer();
|
Buffer * buf = _pEditView->getCurrentBuffer();
|
||||||
|
|
||||||
DWORD dwFileAttribs = ::GetFileAttributes(buf->getFullPathName());
|
DWORD dwFileAttribs = ::GetFileAttributes(buf->getFullPathName());
|
||||||
dwFileAttribs ^= FILE_ATTRIBUTE_READONLY;
|
dwFileAttribs &= ~FILE_ATTRIBUTE_READONLY;
|
||||||
|
|
||||||
::SetFileAttributes(buf->getFullPathName(), dwFileAttribs);
|
::SetFileAttributes(buf->getFullPathName(), dwFileAttribs);
|
||||||
buf->setFileReadOnly(false);
|
buf->setFileReadOnly(false);
|
||||||
|
|
Loading…
Reference in New Issue