HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: some files have "name..ext"
Author: Juan Fco Rodriguez
Date: 06/07/2005 16:51
 
This patch is the final one ! I SWEAR!

--- htsname.c.orig      Tue Jun  7 15:57:33 2005
+++ htsname.c   Tue Jun  7 16:30:42 2005
@@ -807,14 +807,20 @@
             *b='\0';
             if (dot_pos) {
               if (!short_ver)    // Noms longs
-                strcpybuff(b,dot_pos+1);
+                strcpybuff(b,dot_pos);
               else
-                strncatbuff(b,dot_pos+1,3);
+                strncatbuff(b,dot_pos,4);
             } else {
-              if (!short_ver)    // Noms longs
-                strcpybuff(b,DEFAULT_EXT);    // pas de..
-              else
-                strcpybuff(b,DEFAULT_EXT_SHORT);    // pas de..
+              if (!short_ver) {    // Noms longs
+               char *aux = DEFAULT_EXT;
+               if( aux != NULL )
+                   strcpybuff(b,aux);    // pas de..
+              }
+              else {
+               char *aux = DEFAULT_EXT_SHORT;
+                if( aux != NULL )
+                   strcpybuff(b,aux);    // pas de..
+              }
             }
             b+=strlen(b);   // pointer à la fin
             //
@@ -827,10 +833,20 @@
               else
                 strncatbuff(b,dot_pos+1,3);
             } else {
-              if (!short_ver)    // Noms longs
-                strcpybuff(b,DEFAULT_EXT);    // pas de..
-              else
-                strcpybuff(b,DEFAULT_EXT_SHORT);    // pas de..
+              if (!short_ver) {   // Noms longs
+               char *aux = DEFAULT_EXT;
+                if( aux != NULL )
+                   strcpybuff(b,aux+1);    // pas de..
+               else
+                  *(b-1) = '\0';
+              }
+              else {
+               char *aux = DEFAULT_EXT_SHORT;
+               if( aux != NULL )
+                   strcpybuff(b,aux+1);    // pas de..
+               else
+                  *(b-1) = '\0';
+              }
             }
             b+=strlen(b);   // pointer à la fin
             break;
@@ -889,7 +905,18 @@
             strcatbuff(b, protocol_str[protocol]);
             b+=strlen(b);   // pointer à la fin
                  break;
-        }
+       case 'k':
+            {
+               char *d = strchr(fil_complete,'?');
+              *b='\0';
+              if( d != NULL )
+               {
+                 strcatbuff(b, d);
+                  b+=strlen(b);
+              }
+            }
+            break;
+       }
       } else
         *b++=*a++;
     }
 
Reply Create subthread


All articles

Subject Author Date
some files have "name..ext"

06/07/2005 16:28
Re: some files have "name..ext"

06/07/2005 16:36
Re: some files have "name..ext"

06/07/2005 16:51
Re: some files have "name..ext"

06/19/2005 16:01




5

Created with FORUM 2.0.11