HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: some files have "name..ext"
Author: Juan Fco Rodriguez
Date: 06/07/2005 16:36
 
If you ever make possible to override DEFAULT_EXT constant,
my patch will crash if it's defined as NULL, so what about this one better:

--- htsname.c.orig      Tue Jun  7 15:57:33 2005
+++ htsname.c   Tue Jun  7 16:19:33 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+1);    // pas de..
+              }
+              else {
+               char *aux = DEFAULT_EXT_SHORT;
+                if( aux != NULL )
+                   strcpybuff(b,aux+1);    // pas de..
+              }
             }
             b+=strlen(b);   // pointer à la fin
             //
@@ -827,10 +833,16 @@
               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 {
+               char *aux = DEFAULT_EXT_SHORT;
+               if( aux != NULL )
+                   strcpybuff(b,aux+1);    // pas de..
+              }
             }
             b+=strlen(b);   // pointer à la fin
             break;
@@ -889,7 +901,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




9

Created with FORUM 2.0.11