--- rpl/src/instructions_i2.c 2011/08/09 11:31:33 1.31 +++ rpl/src/instructions_i2.c 2012/05/21 17:25:43 1.40 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.3 - Copyright (C) 1989-2011 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.9 + Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. @@ -782,7 +782,12 @@ instruction_input(struct_processus *s_et { struct_objet *s_objet_resultat; + unsigned char *ptr_e; + unsigned char *ptr_l; unsigned char *tampon; + unsigned char *tampon2; + + unsigned long i; (*s_etat_processus).erreur_execution = d_ex; @@ -848,7 +853,45 @@ instruction_input(struct_processus *s_et } free((unsigned char *) (*s_objet_resultat).objet); - (*s_objet_resultat).objet = tampon; + + ptr_l = tampon; + i = 0; + + while((*ptr_l) != d_code_fin_chaine) + { + if ((*ptr_l) == '\"') + { + i++; + } + + ptr_l++; + } + + if ((tampon2 = malloc((strlen(tampon) + 1 + i) * + sizeof(unsigned char))) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } + + ptr_l = tampon; + ptr_e = tampon2; + + while((*ptr_l) != d_code_fin_chaine) + { + if ((*ptr_l) == '\"') + { + (*ptr_e) = '\\'; + ptr_e++; + } + + (*ptr_e) = (*ptr_l); + ptr_e++; + ptr_l++; + } + + free(tampon); + (*s_objet_resultat).objet = tampon2; add_history((unsigned char *) (*s_objet_resultat).objet); stifle_history(ds_longueur_historique); @@ -1160,11 +1203,11 @@ instruction_int(struct_processus *s_etat return; } - if (((*s_objet_argument_3).type == NOM) || - ((*s_objet_argument_3).type == ALG) || - ((*s_objet_argument_3).type == RPN) || - ((*s_objet_argument_3).type == REL) || - ((*s_objet_argument_3).type == INT)) + if (((*s_objet_argument_3).type != NOM) && + ((*s_objet_argument_3).type != ALG) && + ((*s_objet_argument_3).type != RPN) && + ((*s_objet_argument_3).type != REL) && + ((*s_objet_argument_3).type != INT)) { liberation(s_etat_processus, s_objet_argument_1); liberation(s_etat_processus, s_objet_argument_2);