 +   case 0:
 +      /* Strip prefix */
 +      if (get_cmd(ua, _("Please enter path prefix to strip: "))) {
-+	 if (strip_prefix) free(strip_prefix);
++	 if (strip_prefix) bfree(strip_prefix);
 +	 strip_prefix = bstrdup(ua->cmd);
 +      }
 +      

          /* JobId */
          jid = NULL;                  /* force reprompt */
          jcr->RestoreJobId = 0;
@@ -775,6 +786,127 @@
    return 0;                       /* do not run */
 }
 

+	    if (res->res_job.RestoreWhere) {
+	       free(res->res_job.RestoreWhere);
+	    }
+	    int len = bregexp_get_build_where_size(res->res_job.strip_prefix,
+						   res->res_job.add_prefix,
+						   res->res_job.add_suffix);
+	    res->res_job.RestoreWhere = (char *) bmalloc (len * sizeof(char));
+	    bregexp_build_where(res->res_job.RestoreWhere, len,
+				res->res_job.strip_prefix,
+				res->res_job.add_prefix,
+				res->res_job.add_suffix);
+	    res->res_job.where_use_regexp = true;
+
+	    /* TODO: test bregexp */
+	 }
          break;
