Diff for /Amaya/amaya/AHTURLTools.c between versions 1.12 and 1.13

version 1.12, 1997/01/21 16:18:42 version 1.13, 1997/01/22 10:18:19
Line 155  char               *path; Line 155  char               *path;
    int                 i;     int                 i;
   
    if (!path)     if (!path)
       return FALSE;       return (FALSE);
   
    strcpy (temppath, path);     strcpy (temppath, path);
    ExtractSuffix (temppath, suffix);     ExtractSuffix (temppath, suffix);
Line 163  char               *path; Line 163  char               *path;
    /* Normalize the suffix */     /* Normalize the suffix */
    i = 0;     i = 0;
    while (suffix[i] != EOS)     while (suffix[i] != EOS)
       nsuffix[i] = TOLOWER (suffix[i++]);       {
          nsuffix[i] = TOLOWER (suffix[i]);
          i++;
        }
    nsuffix[i] = EOS;     nsuffix[i] = EOS;
    if ((strcmp (nsuffix, "html")) &&     if ((strcmp (nsuffix, "html")) &&
        (strcmp (nsuffix, "htm")) &&         (strcmp (nsuffix, "htm")) &&
        (strcmp (nsuffix, "shtml")))         (strcmp (nsuffix, "shtml")))
       return FALSE;       return (FALSE);
    return TRUE;     else if ((!strcmp (nsuffix, "gz")) ||
               (!strcmp (nsuffix, "Z")))
        {
          /* take in account compressed files */
          ExtractSuffix (temppath, suffix);       
          /* Normalize the suffix */
          i = 0;
          while (suffix[i] != EOS)
            {
              nsuffix[i] = TOLOWER (suffix[i]);
              i++;
            }
          nsuffix[i] = EOS;
          if ((strcmp (nsuffix, "html")) &&
              (strcmp (nsuffix, "htm")) &&
              (strcmp (nsuffix, "shtml")))
            return (FALSE);
          else
            return (TRUE);
        }
      else
        return (TRUE);
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 189  char               *path; Line 213  char               *path;
    int                 i;     int                 i;
   
    if (!path)     if (!path)
       return FALSE;        return (FALSE);
   
    strcpy (temppath, path);     strcpy (temppath, path);
    ExtractSuffix (temppath, suffix);     ExtractSuffix (temppath, suffix);
Line 197  char               *path; Line 221  char               *path;
    /* Normalize the suffix */     /* Normalize the suffix */
    i = 0;     i = 0;
    while (suffix[i] != EOS)     while (suffix[i] != EOS)
       nsuffix[i] = TOLOWER (suffix[i++]);       {
          nsuffix[i] = TOLOWER (suffix[i]);
          i++;
        }
    nsuffix[i] = EOS;     nsuffix[i] = EOS;
    if ((strcmp (nsuffix, "gif")) && (strcmp (nsuffix, "xbm")) &&     if ((strcmp (nsuffix, "gif")) && (strcmp (nsuffix, "xbm")) &&
        (strcmp (nsuffix, "xpm")) && (strcmp (nsuffix, "jpg")) &&         (strcmp (nsuffix, "xpm")) && (strcmp (nsuffix, "jpg")) &&
        (strcmp (nsuffix, "png")) && (strcmp (nsuffix, "au")))         (strcmp (nsuffix, "png")) && (strcmp (nsuffix, "au")))
       return FALSE;        return (FALSE);
    return TRUE;     return (TRUE);
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 223  char               *path; Line 250  char               *path;
    int                 i;     int                 i;
   
    if (!path)     if (!path)
       return FALSE;       return (FALSE);
   
    strcpy (temppath, path);     strcpy (temppath, path);
    ExtractSuffix (temppath, suffix);     ExtractSuffix (temppath, suffix);
Line 240  char               *path; Line 267  char               *path;
    if ((strcmp (nsuffix, "gif")) && (strcmp (nsuffix, "xbm")) &&     if ((strcmp (nsuffix, "gif")) && (strcmp (nsuffix, "xbm")) &&
        (strcmp (nsuffix, "xpm")) && (strcmp (nsuffix, "jpg")) &&         (strcmp (nsuffix, "xpm")) && (strcmp (nsuffix, "jpg")) &&
        (strcmp (nsuffix, "pdf")) && (strcmp (nsuffix, "png")) &&         (strcmp (nsuffix, "pdf")) && (strcmp (nsuffix, "png")) &&
        (strcmp (nsuffix, "Z")) && (strcmp (nsuffix, "gz")) &&  
        (strcmp (nsuffix, "tgz")) && (strcmp (nsuffix, "xpg")) &&         (strcmp (nsuffix, "tgz")) && (strcmp (nsuffix, "xpg")) &&
        (strcmp (nsuffix, "xpd")) && (strcmp (nsuffix, "ps")) &&         (strcmp (nsuffix, "xpd")) && (strcmp (nsuffix, "ps")) &&
        (strcmp (nsuffix, "au")))         (strcmp (nsuffix, "au")))
       return TRUE;        return (TRUE);
    return FALSE;     else if ((!strcmp (nsuffix, "gz")) || (!strcmp (nsuffix, "Z")))
        {
          /* take in account compressed files */
          ExtractSuffix (temppath, suffix);       
          /* Normalize the suffix */
          i = 0;
          while (suffix[i] != EOS)
            {
              nsuffix[i] = TOLOWER (suffix[i]);
              i++;
            }
          nsuffix[i] = EOS;
          if ((!strcmp (nsuffix, "html")) ||
              (!strcmp (nsuffix, "htm")) ||
              (!strcmp (nsuffix, "shtml")))
            return (TRUE);
          else
            return (FALSE);
        }
      else
        return (FALSE);
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 404  char               *docName; Line 450  char               *docName;
                      ** length > TtaGetTextAttributeLength (attrHREF) + strlen (orgName)                        ** length > TtaGetTextAttributeLength (attrHREF) + strlen (orgName) 
                    */                     */
                   TtaGiveTextAttributeValue (attrHREF, basename, &length);                    TtaGiveTextAttributeValue (attrHREF, basename, &length);
                     /* base and orgName have to be separated by a DIR_SEP */
                   /*                     if (basename[strlen (basename) - 1] != DIR_SEP)
                      ** base and orgName have to be separated by a DIR_SEP                       {
                    */                        if (IsHTMLName (basename))
                   if (basename[strlen (basename) - 1] != DIR_SEP && tempname[0] != DIR_SEP)                          {
                      strcat (basename, DIR_STR);                            /* remove the document name from basename */
                             length = strlen (basename) - 1;
                             while (basename[length] != DIR_SEP)
                               basename[length--] = EOS;
                           }
                         else if (tempname[0] != DIR_SEP)
                           strcat (basename, DIR_STR);
                       }
                }                 }
              else               else
                basename[0] = EOS;                 basename[0] = EOS;

Removed from v.1.12  
changed lines
  Added in v.1.13


Webmaster