Changeset 2326 in MondoRescue for branches/2.2.10/mondo/src/mondorestore


Ignore:
Timestamp:
Aug 18, 2009, 3:19:54 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3337@localhost: bruno | 2009-08-11 20:02:18 +0200
bkpinfo->boot_device and bkpinfo->zip_exe are now dynamically allocated

Location:
branches/2.2.10/mondo/src/mondorestore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2325 r2326  
    895895mr_free(value);
    896896
    897 bkpinfo->zip_exe[0] = bkpinfo->zip_suffix[0] = '\0';
     897bkpinfo->zip_suffix[0] = '\0';
    898898value = read_cfg_var(cfg_file, "use-lzo");
    899899if (value && strstr(value, "yes")) {
    900900    bkpinfo->use_lzo = TRUE;
    901901    bkpinfo->use_gzip = FALSE;
    902     strcpy(bkpinfo->zip_exe, "lzop");
     902    mr_free(bkpinfo->zip_exe);
     903    mr_asprintf(bkpinfo->zip_exe, "lzop");
    903904    strcpy(bkpinfo->zip_suffix, "lzo");
    904905}
     
    909910    bkpinfo->use_lzo = FALSE;
    910911    bkpinfo->use_gzip = TRUE;
    911     strcpy(bkpinfo->zip_exe, "gzip");
     912    mr_free(bkpinfo->zip_exe);
     913    mr_asprintf(bkpinfo->zip_exe, "gzip");
    912914    strcpy(bkpinfo->zip_suffix, "gz");
    913915}
     
    918920    bkpinfo->use_lzo = FALSE;
    919921    bkpinfo->use_gzip = FALSE;
    920     strcpy(bkpinfo->zip_exe, "bzip2");
     922    mr_free(bkpinfo->zip_exe);
     923    mr_asprintf(bkpinfo->zip_exe, "bzip2");
    921924    strcpy(bkpinfo->zip_suffix, "bz2");
    922925}
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2325 r2326  
    14881488    }
    14891489
    1490     if (!bkpinfo->zip_exe[0]) {
     1490    if (bkpinfo->zip_exe == NULL) {
    14911491        mr_asprintf(command, "cat > \"%s\"", file_to_openout);
    14921492    } else {
     
    15491549    paranoid_pclose(pout);
    15501550
    1551     if (bkpinfo->zip_exe[0]) {
     1551    if (bkpinfo->zip_exe != NULL) {
    15521552        if (strcmp(bkpinfo->zip_exe, "gzip") == 0) {
    15531553            /* Re-enable SIGPIPE for gzip */
Note: See TracChangeset for help on using the changeset viewer.