Diff for /Amaya/amaya/AHTURLTools.c between versions 1.38 and 1.39

version 1.38, 1997/10/03 09:24:26 version 1.39, 1997/10/03 11:08:11
Line 197  const char         *path; Line 197  const char         *path;
   
    /* Normalize the suffix */     /* Normalize the suffix */
    i = 0;     i = 0;
    while (suffix[i] != EOS)     while (suffix[i] != EOS && i < MAX_LENGTH -1)
      {       {
        nsuffix[i] = tolower (suffix[i]);         nsuffix[i] = tolower (suffix[i]);
        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 (TRUE);
    else if (!strcmp (nsuffix, "gz"))     else if (!strcmp (nsuffix, "gz"))
      {       {
        /* take in account compressed files */         /* take into account compressed files */
        ExtractSuffix (temppath, suffix);                ExtractSuffix (temppath, suffix);       
        /* Normalize the suffix */         /* Normalize the suffix */
        i = 0;         i = 0;
        while (suffix[i] != EOS)         while (suffix[i] != EOS && i < MAX_LENGTH -1)
          {           {
            nsuffix[i] = tolower (suffix[i]);             nsuffix[i] = tolower (suffix[i]);
            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);  
        else  
          return (TRUE);           return (TRUE);
          else
            return (FALSE);
      }       }
    else     else
      return (TRUE);       return (FALSE);
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 254  const char         *path; Line 254  const char         *path;
   
    /* Normalize the suffix */     /* Normalize the suffix */
    i = 0;     i = 0;
    while (suffix[i] != EOS)     while (suffix[i] != EOS && i < MAX_LENGTH -1)
      {       {
        nsuffix[i] = tolower (suffix[i]);         nsuffix[i] = tolower (suffix[i]);
        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 (TRUE);
    return (TRUE);     return (FALSE);
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 291  const char         *path; Line 291  const char         *path;
   
    /* Normalize the suffix */     /* Normalize the suffix */
    i = 0;     i = 0;
    while (suffix[i] != EOS)     while (suffix[i] != EOS && i < MAX_LENGTH -1)
      {       {
         nsuffix[i] = tolower (suffix[i]);          nsuffix[i] = tolower (suffix[i]);
         i++;          i++;
      }       }
    nsuffix[i] = EOS;     nsuffix[i] = EOS;
   
    if ((strcmp (nsuffix, "gif")) && (strcmp (nsuffix, "xbm")) &&     if ((!strcmp (nsuffix, "txt")) || (!strcmp (nsuffix, "dtd")))
        (strcmp (nsuffix, "xpm")) && (strcmp (nsuffix, "jpg")) &&  
        (strcmp (nsuffix, "pdf")) && (strcmp (nsuffix, "png")) &&  
        (strcmp (nsuffix, "tgz")) && (strcmp (nsuffix, "tar")) &&  
        (strcmp (nsuffix, "xpg")) && (strcmp (nsuffix, "xpd")) &&  
        (strcmp (nsuffix, "ps"))  && (strcmp (nsuffix, "au")))  
       return (TRUE);        return (TRUE);
    else if (!strcmp (nsuffix, "gz"))     else if (!strcmp (nsuffix, "gz"))
      {       {
        /* take in account compressed files */         /* take into account compressed files */
        ExtractSuffix (temppath, suffix);                ExtractSuffix (temppath, suffix);       
        /* Normalize the suffix */         /* Normalize the suffix */
        i = 0;         i = 0;
        while (suffix[i] != EOS)         while (suffix[i] != EOS && i < MAX_LENGTH -1)
          {           {
            nsuffix[i] = tolower (suffix[i]);             nsuffix[i] = tolower (suffix[i]);
            i++;             i++;
          }           }
        nsuffix[i] = EOS;         nsuffix[i] = EOS;
        if ((!strcmp (nsuffix, "html")) ||         if ((!strcmp (nsuffix, "txt")) || (!strcmp (nsuffix, "dtd")))
            (!strcmp (nsuffix, "htm")) ||  
            (!strcmp (nsuffix, "shtml")))  
          return (TRUE);           return (TRUE);
        else         else
          return (FALSE);           return (FALSE);
Line 437  Document            doc; Line 430  Document            doc;
   int                 length;    int                 length;
   
   basename = TtaGetMemory (MAX_LENGTH);    basename = TtaGetMemory (MAX_LENGTH);
   strcpy (basename, DocumentURLs[doc]);    strncpy (basename, DocumentURLs[doc], MAX_LENGTH-1);
     basename[MAX_LENGTH-1] = EOS;
   length = MAX_LENGTH -1;    length = MAX_LENGTH -1;
   /* get the root element    */    /* get the root element    */
   el = TtaGetMainRoot (doc);    el = TtaGetMainRoot (doc);
Line 582  char               *docName; Line 576  char               *docName;
    ptr = orgName;     ptr = orgName;
    /* skip leading white space and new line characters */     /* skip leading white space and new line characters */
    while ((*ptr == ' ' || *ptr == EOL) && *ptr++ != EOS);     while ((*ptr == ' ' || *ptr == EOL) && *ptr++ != EOS);
    strcpy (tempOrgName, ptr);     strncpy (tempOrgName, ptr, MAX_LENGTH -1);
      tempOrgName[MAX_LENGTH -1] = EOS;
    /* clean trailing white space */     /* clean trailing white space */
    ptr = strchr (tempOrgName, ' ');     ptr = strchr (tempOrgName, ' ');
    if (ptr)     if (ptr)
Line 1373  char            *aName; Line 1368  char            *aName;
 char            *relatedName;  char            *relatedName;
 #endif  /* __STDC__ */  #endif  /* __STDC__ */
 {  {
   char      *return_value;    char          *return_value;
   char       result[MAX_LENGTH];    char           result[MAX_LENGTH];
   char          *p;    char          *p;
   char          *q;    char          *q;
   char          *after_access;    char          *after_access;

Removed from v.1.38  
changed lines
  Added in v.1.39


Webmaster