Changeset 3835 in MondoRescue for branches/3.3/mondo/src/common


Ignore:
Timestamp:
Mar 5, 2024, 2:06:28 AM (18 months ago)
Author:
Bruno Cornec
Message:

manages prefix dynamically

Location:
branches/3.3/mondo/src/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-cli.c

    r3832 r3835  
    682682
    683683    if (flag_set['p']) {
    684         strncpy(bkpinfo->prefix, flag_val['p'],(MAX_STR_LEN / 4)-1);
     684        mr_asprintf(bkpinfo->prefix, "%s", flag_val['p']);
    685685        log_msg(1,"Prefix forced to %s",bkpinfo->prefix);
    686686    }
  • branches/3.3/mondo/src/common/libmondo-devices.c

    r3834 r3835  
    26252625        bkpinfo->netfs_remote_dir = mr_strip_spaces(tmp1);
    26262626
    2627         if (!popup_and_get_string("Prefix.", "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files", bkpinfo->prefix,(MAX_STR_LEN / 4)-1)) {
     2627        tmp = popup_and_get_string("Prefix.", "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files", bkpinfo->prefix);
     2628        if (tmp == NULL) {
    26282629            log_to_screen("User has chosen not to backup the machine");
    26292630            finish(1);
    26302631        }
     2632        mr_free(bkpinfo->prefix);
     2633        bkpinfo->prefix = tmp;
    26312634        log_msg(3, "prefix set to %s", bkpinfo->prefix);
    26322635        log_msg(3, "Just set netfs_remote_dir to %s", bkpinfo->netfs_remote_dir);
     
    26592662            }
    26602663        }
    2661         if (!popup_and_get_string("Prefix.", "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files", bkpinfo->prefix,(MAX_STR_LEN / 4)-1)) {
     2664        tmp = popup_and_get_string("Prefix.", "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files", bkpinfo->prefix);
     2665        if (tmp == NULL) {
    26622666            log_to_screen("User has chosen not to backup the machine");
    26632667            finish(1);
    26642668        }
     2669        mr_free(bkpinfo->prefix);
     2670        bkpinfo->prefix = tmp;
    26652671        log_msg(3, "prefix set to %s", bkpinfo->prefix);
    26662672        break;
     
    28882894    log_it("media size = %ld", bkpinfo->media_size);
    28892895    log_it("media type = %s", bkptype_to_string(bkpinfo->backup_media_type));
    2890     if (bkpinfo->prefix) {
     2896    if (bkpinfo->prefix != NULL) {
    28912897        log_it("prefix = %s", bkpinfo->prefix);
    28922898    }
  • branches/3.3/mondo/src/common/newt-specific.c

    r3834 r3835  
    441441        mr_free(bkpinfo->tmpdir);
    442442        mr_free(bkpinfo->scratchdir);
     443        mr_free(bkpinfo->prefix);
    443444        /* Then free the structure */
    444445        paranoid_free(bkpinfo);
Note: See TracChangeset for help on using the changeset viewer.