--- rpl/src/instructions_s2.c 2010/02/26 19:22:05 1.4 +++ rpl/src/instructions_s2.c 2010/04/21 13:45:49 1.11 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.11 + RPL/2 (R) version 4.0.15 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -1092,12 +1092,6 @@ instruction_str_fleche(struct_processus if ((*s_objet).type == CHN) { - position_courante = (*s_etat_processus).position_courante; - registre_definitions_chainees = (*s_etat_processus) - .definitions_chainees; - registre_instruction_courante = (*s_etat_processus) - .instruction_courante; - // Comptage des caractères à protéger. drapeau45 = test_cfsf(s_etat_processus, 45); @@ -1127,9 +1121,29 @@ instruction_str_fleche(struct_processus if (presence_chaine == d_vrai) { - if ((*ptr_l) == '\\') + switch(*ptr_l) + { + case '\\': + case '\t': + case '\b': + case '\n': + { + nombre_caracteres_supplementaires++; + break; + } + } + } + else + { + switch(*ptr_l) { - nombre_caracteres_supplementaires++; + case '\n': + case '\b': + case '\t': + { + nombre_caracteres_supplementaires--; + break; + } } } @@ -1163,9 +1177,47 @@ instruction_str_fleche(struct_processus if (presence_chaine == d_vrai) { - if ((*ptr_l) == '\\') + switch(*ptr_l) { - (*(++ptr_e)) = '\\'; + case '\\': + { + (*(++ptr_e)) = '\\'; + break; + } + + case '\t': + { + (*ptr_e) = '\\'; + (*(++ptr_e)) = 't'; + break; + } + + case '\b': + { + (*ptr_e) = '\\'; + (*(++ptr_e)) = 'b'; + break; + } + + case '\n': + { + (*ptr_e) = '\\'; + (*(++ptr_e)) = 'n'; + break; + } + } + } + else + { + switch(*ptr_l) + { + case '\n': + case '\b': + case '\t': + { + ptr_e--; + break; + } } } @@ -1175,6 +1227,12 @@ instruction_str_fleche(struct_processus (*ptr_e) = d_code_fin_chaine; + position_courante = (*s_etat_processus).position_courante; + registre_definitions_chainees = (*s_etat_processus) + .definitions_chainees; + registre_instruction_courante = (*s_etat_processus) + .instruction_courante; + (*s_etat_processus).position_courante = 0; (*s_etat_processus).definitions_chainees = chaine_convertie; free(tampon);