Imported Upstream version 2.4.5
[debian/amanda] / server-src / find.c
index 61c279bd8d377bf064b0b67906e2b309f7397b91..cc07fb1b804e47d277adc8cea48d7eb5ee7a2371 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: find.c,v 1.6.2.4.4.2.2.5 2003/10/27 18:33:03 martinea Exp $
+ * $Id: find.c,v 1.6.2.4.4.2.2.5.2.1 2004/02/02 20:29:12 martinea Exp $
  *
  * controlling process for the Amanda backup system
  */
@@ -253,7 +253,20 @@ find_result_t **output_find;
                    find_result_t *new_output_find =
                        alloc(sizeof(find_result_t));
                    new_output_find->next=*output_find;
-                   new_output_find->datestamp=atoi(dir->name);
+                   if(strlen(dir->name) == 8) {
+                       new_output_find->datestamp=atoi(dir->name);
+                       new_output_find->timestamp=stralloc2(dir->name, "000000");
+                   }
+                   else if(strlen(dir->name) == 14) {
+                       char *name = stralloc(dir->name);
+                       name[8] = '\0';
+                       new_output_find->datestamp=atoi(name);
+                       new_output_find->timestamp=stralloc(dir->name);
+                       amfree(name);
+                   }
+                   else {
+                       error("Bad date\n");
+                   }
                    new_output_find->datestamp_aux=1001;
                    new_output_find->hostname=hostname;
                    hostname = NULL;
@@ -659,6 +672,8 @@ int datestamp, datestamp_aux;
                        (find_result_t *)alloc(sizeof(find_result_t));
                    new_output_find->next=*output_find;
                    new_output_find->datestamp=datestampI;
+                   new_output_find->timestamp = alloc(15);
+                   ap_snprintf(new_output_find->timestamp, 15, "%d000000", datestampI);
                    new_output_find->datestamp_aux=datestamp_aux;
                    new_output_find->hostname=stralloc(host);
                    new_output_find->diskname=stralloc(disk);
@@ -677,6 +692,8 @@ int datestamp, datestamp_aux;
                    new_output_find->next=*output_find;
                    new_output_find->datestamp=datestamp;
                    new_output_find->datestamp_aux=datestamp_aux;
+                   new_output_find->timestamp = alloc(15);
+                   ap_snprintf(new_output_find->timestamp, 15, "%d000000", datestamp);
                    new_output_find->hostname=stralloc(host);
                    new_output_find->diskname=stralloc(disk);
                    new_output_find->level=level;