On 03/25/2010 08:07 PM, Pavel Sanda wrote:
hi,

this is not fixing the root of #6587 but at least we add some
safety measures. since its touching sensitive area of code,
i'd like to ask for review before committing.

I read the thread on the bug. This is weird and annoying. From what I can tell, your approach seems reasonable.

i have a small doubt whether this snippet
// Saving failed, so backup is not backup
                 if (madeBackup)
-                        backupName.moveTo(d->filename);
+                        backupName.copyTo(d->filename);

wouldnt be better this way
// Saving failed, so backup is not backup
                 if (madeBackup)
                          backupName.moveTo(d->filename);
+                        d->filename.copyTo(d->backupName);


I'm a bit puzzled here. Why can't we just move the backup file back to where it was and do nothing else? Is the thought that we ought to have a backup? Having two copies of the file doesn't help much. But what we could do is move the original backup file, too, rather than over-writing it. Then, if the backup fails, it can be restored; if it succeeds, it can be deleted. In effect, we restore the original situation.

rh

Reply via email to