--- rpl/src/instructions_r3.c 2010/03/04 10:17:52 1.4 +++ rpl/src/instructions_r3.c 2010/03/04 17:42:46 1.5 @@ -1044,20 +1044,43 @@ instruction_recall(struct_processus *s_e return; } - if ((commande = malloc((strlen(ds_preprocesseur) + - (2 * strlen((unsigned char *) (*s_objet).objet)) + - (4 * strlen(d_exec_path)) + - strlen(nom_fichier_temporaire) + strlen(instructions) - 11) * - sizeof(unsigned char))) == NULL) + if ((*s_etat_processus).rpl_home == NULL) { - (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; - return; + if ((commande = malloc((strlen(ds_preprocesseur) + + (2 * strlen((unsigned char *) (*s_objet).objet)) + + (4 * strlen(d_exec_path)) + + strlen(nom_fichier_temporaire) + strlen(instructions) - 11) + * sizeof(unsigned char))) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } + + sprintf(commande, instructions, d_exec_path, + (unsigned char *) (*s_objet).objet, + d_exec_path, d_exec_path, + (unsigned char *) (*s_objet).objet, + d_exec_path, ds_preprocesseur, nom_fichier_temporaire); } + else + { + if ((commande = malloc((strlen(ds_preprocesseur) + + (2 * strlen((unsigned char *) (*s_objet).objet)) + + (4 * strlen((*s_etat_processus).rpl_home)) + + strlen(nom_fichier_temporaire) + strlen(instructions) - 11) + * sizeof(unsigned char))) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } - sprintf(commande, instructions, d_exec_path, - (unsigned char *) (*s_objet).objet, - d_exec_path, d_exec_path, (unsigned char *) (*s_objet).objet, - d_exec_path, ds_preprocesseur, nom_fichier_temporaire); + sprintf(commande, instructions, (*s_etat_processus).rpl_home, + (unsigned char *) (*s_objet).objet, + (*s_etat_processus).rpl_home, (*s_etat_processus).rpl_home, + (unsigned char *) (*s_objet).objet, + (*s_etat_processus).rpl_home, ds_preprocesseur, + nom_fichier_temporaire); + } if ((pipe = popen(commande, "r")) == NULL) {