Diff for /rpl/src/analyse_notation_algebrique.c between versions 1.44 and 1.53

version 1.44, 2013/03/21 16:31:58 version 1.53, 2014/04/25 07:37:28
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.13    RPL/2 (R) version 4.1.18
   Copyright (C) 1989-2013 Dr. BERTRAND Joël    Copyright (C) 1989-2014 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 116  analyse_algebrique(struct_processus *s_e Line 116  analyse_algebrique(struct_processus *s_e
   
         if (chaine_algebrique[i] == '"')          if (chaine_algebrique[i] == '"')
         {          {
             presence_chaine = (presence_chaine == d_faux) ? d_vrai : d_faux;              if (chaine_algebrique[i - 1] != '\\')
               {
                   presence_chaine = (presence_chaine == d_faux) ? d_vrai : d_faux;
               }
         }          }
         else if (presence_chaine == d_faux)          else if (presence_chaine == d_faux)
         {          {
Line 177  analyse_algebrique(struct_processus *s_e Line 180  analyse_algebrique(struct_processus *s_e
     {      {
         if ((*ptr1) == '"')          if ((*ptr1) == '"')
         {          {
             if (presence_chaine == d_faux)              if (ptr1 != chaine_travail)
             {              { // Il existe un caractère précédent.
                 presence_chaine = d_vrai;                  if ((*(ptr1 - 1)) != '\\')
                   {
                       if (presence_chaine == d_faux)
                       {
                           presence_chaine = d_vrai;
                       }
                       else
                       {
                           presence_chaine = d_faux;
                       }
                   }
             }              }
             else              else
             {              { // Il n'existe pas de caractère précédent.
                 presence_chaine = d_faux;                  if (presence_chaine == d_faux)
                   {
                       presence_chaine = d_vrai;
                   }
                   else
                   {
                       presence_chaine = d_faux;
                   }
             }              }
         }          }
   
Line 268  analyse_algebrique(struct_processus *s_e Line 288  analyse_algebrique(struct_processus *s_e
                 }                  }
                 else if (chaine_travail[i] == '"')                  else if (chaine_travail[i] == '"')
                 {                  {
                     presence_chaine = (presence_chaine == d_vrai)                      if (i > 0)
                             ? d_faux : d_vrai;                      {
                           if (chaine_travail[i - 1] != '\\')
                           {
                               presence_chaine = (presence_chaine == d_vrai)
                                       ? d_faux : d_vrai;
                           }
                       }
                       else
                       {
                           presence_chaine = (presence_chaine == d_vrai)
                                   ? d_faux : d_vrai;
                       }
                 }                  }
   
                 i++;                  i++;
Line 306  analyse_algebrique(struct_processus *s_e Line 337  analyse_algebrique(struct_processus *s_e
   
                 if (chaine_travail[j] == '"')                  if (chaine_travail[j] == '"')
                 {                  {
                     presence_chaine = (presence_chaine == d_vrai)                      if (j > 0)
                             ? d_faux : d_vrai;                      {
                           if (chaine_travail[j - 1] != '\\')
                           {
                               presence_chaine = (presence_chaine == d_vrai)
                                       ? d_faux : d_vrai;
                           }
                       }
                       else
                       {
                           presence_chaine = (presence_chaine == d_vrai)
                                   ? d_faux : d_vrai;
                       }
                 }                  }
   
                 j++;                  j++;
Line 358  analyse_algebrique(struct_processus *s_e Line 400  analyse_algebrique(struct_processus *s_e
                 {                  {
                     if (chaine_centrale[i] == '"')                      if (chaine_centrale[i] == '"')
                     {                      {
                         presence_chaine = (presence_chaine == d_faux)                          if (i > 0)
                                 ? d_vrai : d_faux;                          {
                               if (chaine_centrale[i - 1] != '\\')
                               {
                                   presence_chaine = (presence_chaine == d_faux)
                                           ? d_vrai : d_faux;
                               }
                           }
                           else
                           {
                               presence_chaine = (presence_chaine == d_faux)
                                       ? d_vrai : d_faux;
                           }
   
                         if (i == 1)                          if (i == 1)
                         {                          {
Line 1166  test_expression_rpn(unsigned char *chain Line 1219  test_expression_rpn(unsigned char *chain
         if (chaine[i - 1] == '"')          if (chaine[i - 1] == '"')
         {          {
             i++;              i++;
             while(chaine[i - 1] != '"')              while(!((chaine[i - 1] == '"') && (chaine[i - 2] != '\\')))
             {              {
                 i++;                  i++;
             }              }
Line 1315  extraction_chaine(unsigned char *chaine, Line 1368  extraction_chaine(unsigned char *chaine,
     unsigned char           *sous_chaine;      unsigned char           *sous_chaine;
   
     if ((position_1 < 1) || (position_2 < position_1) ||      if ((position_1 < 1) || (position_2 < position_1) ||
             (position_1 > ((integer8) strlen(chaine))))              (position_2 > ((integer8) strlen(chaine))))
     {  
         if ((sous_chaine = (unsigned char *) malloc(sizeof(unsigned char)))  
                 == NULL)  
         {  
             return(NULL);  
         }  
   
         (*sous_chaine) = d_code_fin_chaine;  
         return(sous_chaine);  
     }  
   
     if (position_2 > ((integer8) strlen(chaine)))  
     {      {
         if ((sous_chaine = (unsigned char *) malloc(sizeof(unsigned char)))          if ((sous_chaine = (unsigned char *) malloc(sizeof(unsigned char)))
                 == NULL)                  == NULL)

Removed from v.1.44  
changed lines
  Added in v.1.53


CVSweb interface <joel.bertrand@systella.fr>