- slot = atoi(sd->msg);
- bsendmsg(ua, "Got slot=%d label: %s\n", slot, p);
+ vl = (vol_list_t *)malloc(sizeof(vol_list_t));
+ vl->Slot = atoi(sd->msg);
+ vl->VolName = bstrdup(p);
+ vl->next = vol_list;
+ vol_list = vl;
+ }
+
+ if (!vol_list) {
+ bsendmsg(ua, _("No Volumes found to label, or no barcodes.\n"));
+ goto bail_out;
+ }
+ bsendmsg(ua, _("The following Volumes will be labeled:\n"
+ "Slot Volume\n"
+ "==============\n"));
+ for (vl=vol_list; vl; vl=vl->next) {
+ bsendmsg(ua, "%4d %s\n", vl->Slot, vl->VolName);
+ }
+ if (!get_cmd(ua, _("Do you want to continue? (y/n): ")) ||
+ (ua->cmd[0] != 'y' && ua->cmd[0] != 'Y')) {
+ goto bail_out;