Imported Upstream version 2.5.1p3
[debian/amanda] / recover-src / extract_list.c
index 67c02d1bd10325a8c5ee358ef6fbeb61952ee95e..4cd35b22e5e23cf701d7e8ff02f92f25fb426392 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: extract_list.c,v 1.117 2006/08/24 01:57:15 paddy_s Exp $
+ * $Id: extract_list.c,v 1.117.2.2 2006/12/22 15:10:26 martinea Exp $
  *
  * implements the "extract" command in amrecover
  */
@@ -743,6 +743,7 @@ add_file(
     ssize_t j;
     char *dir, *dir_undo, dir_undo_ch = '\0';
     char *ditem_path = NULL;
+    char *qditem_path = NULL;
     char *l = NULL;
     int  added;
     char *s, *fp, *quoted;
@@ -762,7 +763,6 @@ add_file(
        regex = "\\.[/]*$";
     }
     else if(strcmp(regex, "[^/]*[/]*$") == 0) {                /* "*" */
-       //regex = 
        regex = "([^/.]|\\.[^/]+|[^/.][^/]*)[/]*$";
     } else {
        /* remove "/" at end of path */
@@ -810,7 +810,9 @@ add_file(
                ditem_path = newstralloc(ditem_path, ditem->path);
                clean_pathname(ditem_path);
 
-               cmd = stralloc2("ORLD ", ditem_path);
+               qditem_path = quote_string(ditem_path);
+               cmd = stralloc2("ORLD ", qditem_path);
+               amfree(qditem_path);
                if(send_command(cmd) == -1) {
                    amfree(cmd);
                    amfree(ditem_path);
@@ -1063,6 +1065,7 @@ delete_file(
     int  level = 0;
     off_t fileno;
     char *ditem_path = NULL;
+    char *qditem_path;
     char *l = NULL;
     int  deleted;
     char *s;
@@ -1128,7 +1131,9 @@ delete_file(
                ditem_path = newstralloc(ditem_path, ditem->path);
                clean_pathname(ditem_path);
 
-               cmd = stralloc2("ORLD ", ditem_path);
+               qditem_path = quote_string(ditem_path);
+               cmd = stralloc2("ORLD ", qditem_path);
+               amfree(qditem_path);
                if(send_command(cmd) == -1) {
                    amfree(cmd);
                    amfree(ditem_path);