]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/bsr.c
Fix #1559 problem when restoring pruned jobs with a regexp
[bacula/bacula] / bacula / src / dird / bsr.c
index 96d30c0ca3dd24f6890a6fb78663fb88ad6c8eec..eefce24c7e5b882dbd498a82de4704f65632f1d4 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -34,7 +34,6 @@
  *
  *     Kern Sibbald, July MMII
  *
- *   Version $Id$
  */
 
 #include "bacula.h"
@@ -282,8 +281,7 @@ static void display_vol_info(UAContext *ua, RESTORE_CTX &rx, JobId_t JobId)
             }
             Mmsg(volmsg, "%c%-25.25s %-25.25s %-25.25s", 
                  online, bsr->VolParams[i].VolumeName,
-                 bsr->VolParams[i].Storage,
-                 Device);
+                 bsr->VolParams[i].Storage, Device);
             add_prompt(ua, volmsg.c_str());
          }
       }
@@ -559,8 +557,15 @@ void add_findex_all(RBSR *bsr, uint32_t JobId)
          /* Add new JobId at end of chain */
          for (nbsr=bsr; nbsr->next; nbsr=nbsr->next)
             {  }
+
          nbsr->next = new_bsr();
          nbsr->next->JobId = JobId;
+
+         /* If we use regexp to restore, set it for each jobid */
+         if (bsr->fileregex) { 
+            nbsr->next->fileregex = bstrdup(bsr->fileregex);
+         }
+
          nbsr->next->fi = new_findex();
          nbsr->next->fi->findex = 1;
          nbsr->next->fi->findex2 = INT32_MAX;