Diff for /Amaya/amaya/fetchXMLname.c between versions 1.40 and 1.41

version 1.40, 2001/03/07 10:17:40 version 1.41, 2001/03/07 13:10:44
Line 468  ThotBool   MapXMLEntity (int XMLtype, ST Line 468  ThotBool   MapXMLEntity (int XMLtype, ST
    Returns FALSE if entityValue is not found.     Returns FALSE if entityValue is not found.
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 void MapEntityByCode (int entityValue, char **entityName)  void MapEntityByCode (int entityValue, char **entityName)
   
 {  {
   XmlEntity  *ptr;    XmlEntity  *ptr;
   ThotBool    found;    ThotBool    found;
Line 478  void MapEntityByCode (int entityValue, c Line 477  void MapEntityByCode (int entityValue, c
   ptr = XhtmlEntityTable;    ptr = XhtmlEntityTable;
   if (ptr)    if (ptr)
     {      {
       /* look for the first concerned entry in the table */        /* look for in the HTML entities table */
       found = FALSE;        found = FALSE;
       for (i = 0; ptr[i].charCode >= 0 && !found; i++)        while (ptr && !found)
         found = (ptr[i].charCode == entityValue);  
     
       if (found)  
         {          {
           /* entity value found */            for (i = 0; ptr[i].charCode >= 0 && !found; i++)
           i--;              found = (ptr[i].charCode == entityValue);
           *entityName = (char *) (ptr[i].charName);    
             if (found)
               {
                 /* entity value found */
                 i--;
                 *entityName = (char *) (ptr[i].charName);
               }
             else if (ptr != MathEntityTable)
               /* look for in the Math entities table */
               ptr = MathEntityTable;
             else
               {
                 *entityName = NULL;
                 ptr = NULL;
               }
         }          }
       else  
         *entityName = NULL;  
     }      }
   else    else
     *entityName = NULL;      *entityName = NULL;

Removed from v.1.40  
changed lines
  Added in v.1.41


Webmaster