--- rpl/src/transliteration.c 2010/06/24 10:10:47 1.12 +++ rpl/src/transliteration.c 2010/08/10 18:02:43 1.16 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.17 + RPL/2 (R) version 4.0.18 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -20,8 +20,8 @@ */ -#include "rpl.conv.h" -#include "tex.conv.h" +#include "rpl-conv.h" +#include "tex-conv.h" #include @@ -50,6 +50,14 @@ transliteration(struct_processus *s_etat unsigned char *codage_sortie_transliteral; unsigned char *tampon; +# ifdef OS2 + unsigned char *ptr_e;; + unsigned char *ptr_l;; + unsigned char *tampon2; + + unsigned long i; +# endif + if ((codage_sortie_transliteral = malloc((strlen(codage_sortie) + strlen("//TRANSLIT") + 1) * sizeof(unsigned char))) == NULL) { @@ -63,6 +71,53 @@ transliteration(struct_processus *s_etat codage_entree, codage_sortie_transliteral); free(codage_sortie_transliteral); +# ifdef OS2 + + i = 0; + ptr_l = tampon; + + while((*ptr_l) != d_code_fin_chaine) + { + if ((*ptr_l) == '\n') + { + i++; + } + + ptr_l++; + } + + if ((tampon2 = malloc((strlen(tampon) + i + 1) * sizeof(unsigned char))) + == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return(NULL); + } + + ptr_e = tampon2; + ptr_l = tampon; + + while((*ptr_l) != d_code_fin_chaine) + { + (*ptr_e) = (*ptr_l); + + if ((*ptr_l) == '\n') + { + (*(++ptr_e)) = '\r'; + ptr_e++; + ptr_l++; + } + else + { + ptr_e++; + ptr_l++; + } + } + + free(tampon); + tampon = tampon2; + +# endif + return(tampon); }