summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/htscoremain.c5
-rw-r--r--src/htslib.c1
-rw-r--r--src/htsname.c2
-rw-r--r--src/htsopt.h1
4 files changed, 8 insertions, 1 deletions
diff --git a/src/htscoremain.c b/src/htscoremain.c
index 044e720..21cffd4 100644
--- a/src/htscoremain.c
+++ b/src/htscoremain.c
@@ -1919,6 +1919,11 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
}
break;
+ case 't': /* do not change type (ending) of filenames according to the MIME type */
+ opt->no_type_change = 1;
+ if (*(com+1)=='0') { opt->no_type_change = 0; com++; }
+ break;
+
default:{
char s[HTS_CDLMAXSIZE + 256];
diff --git a/src/htslib.c b/src/htslib.c
index bb46f94..6a9ba4c 100644
--- a/src/htslib.c
+++ b/src/htslib.c
@@ -5464,6 +5464,7 @@ HTSEXT_API httrackp *hts_create_opt(void) {
opt->extdepth = 0; // mais pas à l'extérieur
opt->seeker = 1; // down
opt->urlmode = 2; // relatif par défaut
+ opt->no_type_change = 0; // change file types
opt->debug = 0; // pas de débug en plus
opt->getmode = 3; // linear scan
opt->maxsite = -1; // taille max site (aucune)
diff --git a/src/htsname.c b/src/htsname.c
index 7a9ae25..c652c1c 100644
--- a/src/htsname.c
+++ b/src/htsname.c
@@ -764,7 +764,7 @@ int url_savename(char *adr_complete, char *fil_complete, char *save,
}
// Changer extension?
// par exemple, php3 sera sauvé en html, cgi en html ou gif, xbm etc.. selon les cas
- if (ext_chg) { // changer ext
+ if (ext_chg && !opt->no_type_change) { // changer ext
char *a = fil + strlen(fil) - 1;
if ((opt->debug > 1) && (opt->log != NULL)) {
diff --git a/src/htsopt.h b/src/htsopt.h
index 7e7615f..76dc793 100644
--- a/src/htsopt.h
+++ b/src/htsopt.h
@@ -289,6 +289,7 @@ struct httrackp {
int depth; // nombre de niveaux de récursion
int extdepth; // nombre de niveaux de récursion à l'éxtérieur
int urlmode; // liens relatifs etc
+ int no_type_change; // do not change file type according to MIME
int debug; // mode débug log
int getmode; // sauver html, images..
FILE *log; // fichier log