Ignore:
Timestamp:
Mar 7, 2024, 1:55:18 PM (2 months ago)
Author:
Bruno Cornec
Message:

Change find_my_editor and find_home_of_exe to return dynamically assigned stringsi - adapt whine_if_not_found

File:
1 edited

Legend:

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

    r3863 r3866  
    608608    int res = -1;
    609609    char *command = NULL;
     610    char *tmp = NULL;
    610611
    611612    if (!does_file_exist(input_device)) {
    612613        fatal_error("input device does not exist");
    613614    }
    614     if ( !find_home_of_exe("ntfsclone")) {
     615    if ((tmp = find_home_of_exe("ntfsclone")) == NULL) {
    615616        fatal_error("ntfsclone not found");
    616617    }
    617     mr_asprintf(command, "ntfsclone --rescue --force --save-image --overwrite %s %s", output_fname, input_device);
     618    mr_asprintf(command, "%s --rescue --force --save-image --overwrite %s %s", tmp, output_fname, input_device);
     619    mr_free(tmp);
    618620    res = run_program_and_log_output(command, 5);
    619621    mr_free(command);
     
    717719    int res = -1;
    718720    char *command = NULL;
    719 
    720     if ( !find_home_of_exe("ntfsclone")) {
     721    char *tmp = NULL;
     722
     723    if ((tmp = find_home_of_exe("ntfsclone")) == NULL) {
    721724        fatal_error("ntfsclone not found");
    722725    }
    723     mr_asprintf(command, "ntfsclone --rescue --force --restore-image --overwrite %s %s", output_device, input_fifo);
     726    mr_asprintf(command, "%s --rescue --force --restore-image --overwrite %s %s", tmp, output_device, input_fifo);
     727    mr_free(tmp);
    724728    res = run_program_and_log_output(command, 5);
    725729    mr_free(command);
Note: See TracChangeset for help on using the changeset viewer.