Diff for /Amaya/amaya/AHTURLTools.c between versions 1.96 and 1.97

version 1.96, 2000/03/23 11:04:48 version 1.97, 2000/03/23 15:27:17
Line 956  CHAR_T *text; Line 956  CHAR_T *text;
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
    CleanCopyFileURL     CleanCopyFileURL
    Copies a file url from a src string to destination string.     Copies a file url from a src string to destination string.
    If conv_dir_sep is TRUE, it changes the URL_SEP into DIR_SEPs if     convertion says which type of convertion (none, %xx, URL_SEP into DIR_SEP
    they are not the same  character.     we want to do).
    It always changes the %xx coded chars into the equivalent char  
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 #ifdef __STDC__  #ifdef __STDC__
 static void CleanCopyFileURL (CHAR_T *dest, CHAR_T *src, ThotBool conv_dir_sep)  static void CleanCopyFileURL (CHAR_T *dest, CHAR_T *src, ConvertionType convertion)
 #else  #else
 static void CleanCopyFileURL (dest, src, conv_dir_sep)  static void CleanCopyFileURL (dest, src, convertion)
 CHAR_T* dest;  CHAR_T* dest;
 CHAR_T* src;  CHAR_T* src;
 ThotBool conv_dir_sep;  ConvertionType convertion;
   
 #endif /* __STDC__ */  #endif /* __STDC__ */
 {  {
Line 977  ThotBool conv_dir_sep; Line 976  ThotBool conv_dir_sep;
 #ifdef _WINDOWS  #ifdef _WINDOWS
         case WC_URL_SEP:          case WC_URL_SEP:
           /* make DIR_SEP transformation */            /* make DIR_SEP transformation */
           if (conv_dir_sep)            if (convertion & AM_CONV_URL_SEP)
             *dest = WC_DIR_SEP;              *dest = WC_DIR_SEP;
           else            else
             *dest = *src;              *dest = *src;
Line 987  ThotBool conv_dir_sep; Line 986  ThotBool conv_dir_sep;
 #endif /* _WINDOWS */  #endif /* _WINDOWS */
   
         case TEXT('%'):          case TEXT('%'):
           /* (code adapted from libwww's HTUnEscape function */            if (convertion & AM_CONV_PERCENT)
           src++;  
           if (*src != WC_EOS)  
             {              {
               *dest = UnEscapeChar (*src) * 16;                /* (code adapted from libwww's HTUnEscape function */
               src++;                src++;
                 if (*src != WC_EOS)
                   {
                     *dest = UnEscapeChar (*src) * 16;
                     src++;
                   }
                 if (*src != WC_EOS)
                   {
                     *dest = *dest + UnEscapeChar (*src);
                     src++;
                   }
                 dest++;
             }              }
           if (*src != WC_EOS)            else
             {              {
               *dest = *dest + UnEscapeChar (*src);                *dest = *src;
                 dest++;
               src++;                src++;
             }              }
           dest++;  
           break;            break;
   
         default:          default:
Line 1854  CHAR_T**     url; Line 1862  CHAR_T**     url;
    Return TRUE if target and src differ.                                Return TRUE if target and src differ.                           
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 #ifdef __STDC__  #ifdef __STDC__
 ThotBool     NormalizeFile (CHAR_T* src, CHAR_T* target, ThotBool force_convertion)  ThotBool     NormalizeFile (CHAR_T* src, CHAR_T* target, ConvertionType convertion)
 #else  #else
 ThotBool     NormalizeFile (src, target, force_convertion)  ThotBool     NormalizeFile (src, target, convertion)
 CHAR_T*              src;  CHAR_T*              src;
 CHAR_T*              target;  CHAR_T*              target;
 ThotBool             force_convertion;  ConvertionType       convertion;
   
 #endif  #endif
 {  {
Line 1906  ThotBool             force_convertion; Line 1914  ThotBool             force_convertion;
        /* if there's nothing afterwards, add a DIR_STR */         /* if there's nothing afterwards, add a DIR_STR */
          ustrcpy (target, WC_DIR_STR);           ustrcpy (target, WC_DIR_STR);
        else         else
          CleanCopyFileURL (target, &src[start_index], TRUE);           /* as we're inside a file: URL, we'll apply all the convertions
               we know */
            CleanCopyFileURL (target, &src[start_index], AM_CONV_ALL);
   
        change = TRUE;         change = TRUE;
      }       }
    else if (force_convertion)     else if (convertion != AM_CONV_NONE)
      {       {
        /* we are following a "local" relative link, we do all the         /* we are following a "local" relative link, we do all the
           convertions except for the HOME_DIR ~ one */            convertions except for the HOME_DIR ~ one */
        CleanCopyFileURL (target, src, TRUE);         CleanCopyFileURL (target, src, convertion);
      }       }
 #ifndef _WINDOWS  #ifndef _WINDOWS
    else if (src[0] == TEXT('~'))     else if (src[0] == TEXT('~'))

Removed from v.1.96  
changed lines
  Added in v.1.97


Webmaster