add bug closure to changelog
[debian/amanda] / server-src / cmdline.c
index 4a08dad0f1cfab5d11002535a7adb14010f90e83..600d50060477ff221816c2e4618aac15f5db0b0e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007-2012 Zmanda, Inc.  All Rights Reserved.
  * 
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -25,8 +25,8 @@
  * Utility routines for handling command lines.
  */
 
-#include <ctype.h>
 #include "amanda.h"
+#include <ctype.h>
 #include "match.h"
 #include "cmdline.h"
 #include "holding.h"
@@ -36,7 +36,8 @@ dumpspec_new(
     char *host, 
     char *disk, 
     char *datestamp,
-    char *level)
+    char *level,
+    char *write_timestamp)
 {
     dumpspec_t *rv;
 
@@ -45,6 +46,7 @@ dumpspec_new(
     if (disk) rv->disk = stralloc(disk);
     if (datestamp) rv->datestamp = stralloc(datestamp);
     if (level) rv->level = stralloc(level);
+    if (write_timestamp) rv->write_timestamp = stralloc(write_timestamp);
 
     return rv;
 }
@@ -58,6 +60,7 @@ dumpspec_free(
     if (dumpspec->disk) free(dumpspec->disk);
     if (dumpspec->datestamp) free(dumpspec->datestamp);
     if (dumpspec->level) free(dumpspec->level);
+    if (dumpspec->write_timestamp) free(dumpspec->write_timestamp);
     free(dumpspec);
 }
 
@@ -90,7 +93,7 @@ cmdline_parse_dumpspecs(
         switch (arg_state) {
             case ARG_GET_HOST:
                 arg_state = ARG_GET_DISK;
-                dumpspec = dumpspec_new(name, NULL, NULL, NULL);
+                dumpspec = dumpspec_new(name, NULL, NULL, NULL, NULL);
                list = g_slist_append(list, (gpointer)dumpspec);
                 break;
 
@@ -124,7 +127,7 @@ cmdline_parse_dumpspecs(
     if (list == NULL && (flags & CMDLINE_EMPTY_TO_WILDCARD)) {
         dumpspec = dumpspec_new("", "", 
                (flags & CMDLINE_PARSE_DATESTAMP)?"":NULL,
-               (flags & CMDLINE_PARSE_LEVEL)?"":NULL);
+               (flags & CMDLINE_PARSE_LEVEL)?"":NULL, "");
        list = g_slist_append(list, (gpointer)dumpspec);
     }
 
@@ -244,7 +247,7 @@ cmdline_match_holding(
        dumpfile_free_data(&file);
     }
 
-    g_slist_free_full(holding_files);
+    slist_free_full(holding_files, g_free);
 
     return matching_files;
 }