On Thu, Dec 13, 2007 at 10:43:35AM -0000, [EMAIL PROTECTED] wrote: > Author: younes > Date: Thu Dec 13 11:43:29 2007 > New Revision: 22124 > > URL: http://www.lyx.org/trac/changeset/22124 > Log: > compile fix following undo/redo mixup. Sorry. > > Modified: > lyx-devel/trunk/src/support/FileName.cpp > lyx-devel/trunk/src/support/FileName.h > > Modified: lyx-devel/trunk/src/support/FileName.cpp > URL: > http://www.lyx.org/trac/file/lyx-devel/trunk/src/support/FileName.cpp?rev=22124 > ============================================================================== > --- lyx-devel/trunk/src/support/FileName.cpp (original) > +++ lyx-devel/trunk/src/support/FileName.cpp Thu Dec 13 11:43:29 2007 > @@ -152,12 +152,12 @@ > > bool FileName::changePermission(unsigned long int mode) const > { > - if (!fname.isWritable()) { > + if (!isWritable()) { > LYXERR0("File " << *this << " is not writable!"); > return false; > }
When you are the file owner, you can change its permissions, even if the file is not writable. So, I would simply delete the above check and fall through attempting to chmod the file. When this is not possible, chmod will flag the error. > - if (!chmod(fname, mode)) { > + if (!chmod(*this, mode)) { > LYXERR0("File " << *this << " cannot be changed to " << mode << > " mode!"); > return false; > } -- Enrico