+ while(1) {
+ puts(_("\nMultiple Amanda runs in holding disks; please pick one by letter:"));
+ for(ds = datestamp_list, max_char = 'A';
+ ds != NULL && max_char <= 'Z';
+ ds = ds->next, max_char++) {
+ g_printf(" %c. %s\n", max_char, (char *)ds->data);
+ }
+ max_char--;
+ g_printf(_("Select datestamps to flush [A..%c or <enter> for all]: "), max_char);
+ fflush(stdout); fflush(stderr);
+ amfree(answer);
+ if ((answer = agets(stdin)) == NULL) {
+ clearerr(stdin);
+ continue;
+ }
+
+ if (*answer == '\0' || strncasecmp(answer, "ALL", 3) == 0) {
+ break;
+ }
+
+ a = answer;
+ while ((ch = *a++) != '\0') {
+ if (!g_ascii_isspace(ch))
+ break;
+ }
+
+ /* rewrite the selected list into r_datestamp_list, then copy it over
+ * to datestamp_list */
+ do {
+ if (g_ascii_isspace(ch) || ch == ',') {
+ continue;
+ }
+ chupper = (char)toupper(ch);
+ if (chupper < 'A' || chupper > max_char) {
+ slist_free_full(r_datestamp_list, g_free);
+ r_datestamp_list = NULL;
+ break;
+ }
+ r_datestamp_list = g_slist_append(r_datestamp_list,
+ stralloc(datestamps[chupper - 'A']));
+ } while ((ch = *a++) != '\0');
+ if (r_datestamp_list && ch == '\0') {
+ slist_free_full(datestamp_list, g_free);
+ datestamp_list = r_datestamp_list;
+ break;
+ }
+ }
+ }
+ amfree(datestamps); /* references in this array are borrowed */
+ amfree(answer);
+
+ return datestamp_list;
+}
+
+
+/*
+ * confirm before detaching and running
+ */
+
+void
+confirm(GSList *datestamp_list)