Only backup if osuffix is set

- This can happen on %ghost files, fsm->ossufix is never set for them.
  Arguably this is a bug in the file disposition calculations but for now...
This commit is contained in:
Panu Matilainen 2012-08-30 13:39:24 +03:00
parent 273a025c50
commit 06242419af
1 changed files with 2 additions and 1 deletions

View File

@ -1527,7 +1527,8 @@ static int fsmBackup(FSM_t fsm)
{
int rc = 0;
if (fsm->action == FA_SAVE || fsm->action == FA_BACKUP) {
/* FIXME: %ghost can have backup action but no suffix */
if ((fsm->action == FA_SAVE || fsm->action == FA_BACKUP) && fsm->osuffix) {
char * opath = fsmFsPath(fsm, S_ISDIR(fsm->sb.st_mode), NULL);
char * path = fsmFsPath(fsm, 0, fsm->osuffix);
rc = fsmRename(opath, path, fsm->mapFlags);