HTTrack Website Copier
Free software offline browser - FORUM
Subject: some files have "name..ext"
Author: Juan Fco Rodriguez
Date: 06/07/2005 16:28
 
Hello,

If I use "-N %h%p/%n.%t", sometimes I see files with
"name..ext". This occurs when the links doen't have
extension. In "htsname.c:...case 't':" if there is
no point, it appends DEFAULT_EXT (which is ".html"). On the other hand, when
an extension exists, 
it appends what is left behind "point_pos + 1",
do you catch it ? I think it's a small bug... A possible patch would be the
following, which includes my '%k' option:

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


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




3

Created with FORUM 2.0.11