Ignore:
Timestamp:
Aug 18, 2009, 2:29:18 PM (11 years ago)
Author:
Bruno Cornec
Message:

r3326@localhost: bruno | 2009-08-01 23:53:09 +0200
resolve_naff_tokens now returns an allocated char

File:
1 edited

Legend:

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

    r2296 r2315  
    101101
    102102    /*@ buffers      *** */
    103     char *midway_call, *ultimate_call, *tmp, *incoming, *old_stderr;
     103    char *midway_call = NULL;
     104    char *ultimate_call = NULL;
     105    char *tmp = NULL;
     106    char *incoming, *old_stderr;
    104107       
    105108    char *cd_number_str = NULL;
     
    113116    log_msg(3, "Starting");
    114117    assert(bkpinfo != NULL);
    115     // BERLIOS: doesn't work even if the string is correct !
    116     //assert_string_is_neither_NULL_nor_zerolength(basic_call);
    117118    assert_string_is_neither_NULL_nor_zerolength(isofile);
    118119    assert_string_is_neither_NULL_nor_zerolength(logstub);
    119     if (!(midway_call = malloc(1200))) {
    120         fatal_error("Cannot malloc midway_call");
    121     }
    122     if (!(ultimate_call = malloc(1200))) {
    123         fatal_error("Cannot malloc ultimate_call");
    124     }
    125     if (!(tmp = malloc(1200))) {
    126         fatal_error("Cannot malloc tmp");
    127     }
    128120    malloc_string(incoming);
    129121    malloc_string(old_stderr);
     
    139131
    140132    mr_asprintf(&cd_number_str, "%d", cd_no);
    141     resolve_naff_tokens(midway_call, tmp1, isofile, "_ISO_");
    142     resolve_naff_tokens(tmp, midway_call, cd_number_str, "_CD#_");
     133    log_msg(4, "basic call = '%s'", tmp1);
     134    midway_call = resolve_naff_tokens(tmp1, isofile, "_ISO_");
     135    mr_free(tmp1);
     136
     137    log_msg(4, "midway_call = '%s'", midway_call);
     138    tmp = resolve_naff_tokens(midway_call, cd_number_str, "_CD#_");
    143139    mr_free(cd_number_str);
    144 
    145     resolve_naff_tokens(ultimate_call, tmp, MONDO_LOGFILE, "_ERR_");
    146     log_msg(4, "basic call = '%s'", tmp1);
    147     log_msg(4, "midway_call = '%s'", midway_call);
     140    mr_free(midway_call);
     141
    148142    log_msg(4, "tmp = '%s'", tmp);
     143    ultimate_call = resolve_naff_tokens(tmp, MONDO_LOGFILE, "_ERR_");
     144    mr_free(tmp);
     145
    149146    log_msg(4, "ultimate call = '%s'", ultimate_call);
    150147    mr_asprintf(&command, "%s >> %s", ultimate_call, MONDO_LOGFILE);
     148    mr_free(ultimate_call);
    151149
    152150    log_to_screen
     
    181179        }
    182180        if (retval) {
    183             log_msg(2, "Basic call '%s' returned an error.", tmp1);
    184             popup_and_OK("Press ENTER to continue.");
    185181            popup_and_OK("mkisofs and/or cdrecord returned an error. CD was not created");
    186182        }
     
    192188    }
    193189    mr_free(command);
    194     mr_free(tmp1);
    195     paranoid_free(midway_call);
    196     paranoid_free(ultimate_call);
    197     paranoid_free(tmp);
    198190    paranoid_free(incoming);
    199191    paranoid_free(old_stderr);
Note: See TracChangeset for help on using the changeset viewer.