Ignore:
Timestamp:
Aug 18, 2009, 2:37:25 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3330@localhost: bruno | 2009-08-05 00:48:36 +0200
bkpinfo->include_paths is now dynamically allocated

File:
1 edited

Legend:

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

    r2318 r2319  
    759759        if (!strcmp(bkpinfo->include_paths, "/")) {
    760760            log_msg(2, "'/' is pleonastic.");
    761             bkpinfo->include_paths[0] = '\0';
    762         }
    763         if (bkpinfo->include_paths[0]) {
    764             strcat(bkpinfo->include_paths, " ");
    765761        }
    766762
     
    801797                log_to_screen("Archiving only the following file systems on %s:\n", token);
    802798                log_to_screen("  %s\n", mounted_on_dsf);
    803                 strcpy(bkpinfo->include_paths, "/");
     799                mr_asprintf(&p, "/");
     800                bkpinfo->include_paths = p;
    804801                if (strlen(not_mounted_on_dsf)) {
    805802                    log_msg (5, "Adding to bkpinfo->exclude_paths due to -I option: %s", not_mounted_on_dsf);
     
    811808            /* A device special file was not passed in. Process it as a path. */
    812809            case -1:
    813                     strcat(bkpinfo->include_paths, token);
    814                     strcat(bkpinfo->include_paths, " ");
     810                mr_strcat(bkpinfo->include_paths, " %s ", token);
    815811                break;
    816812            }
    817813            mr_free(token);
    818814        }
    819         log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
     815        if (bkpinfo->include_paths != NULL) {
     816            log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
     817        }
    820818        if (bkpinfo->exclude_paths != NULL) {
    821819            log_msg(1, "exclude_paths is now '%s'", bkpinfo->exclude_paths);
     
    838836        }
    839837        bkpinfo->make_filelist = FALSE;
    840         strcpy(bkpinfo->include_paths, flag_val['J']);
     838        mr_asprintf(&p, "%s", flag_val['J']);
     839        bkpinfo->include_paths = p;
    841840    }
    842841
Note: See TracChangeset for help on using the changeset viewer.