From 7fd012a6de636fc48cd8cf35580bfa990e6654a1 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 24 Nov 2002 12:21:20 +0000 Subject: [PATCH] Changed debug logging, added more extension translations --- ChangeLog | 2 ++ lib/mangle.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 16bbe2f4..7eb37627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,8 @@ v0.35.06 followed by a tilde and 2 characters code calculated from the checksum of the string modulo 1849. Both methods are different then what MS does. + Added long extension to 3 char extensions for mpeg, smil, perl, + jpeg and tiff. mbsebbs: Several user input functions don't allow comma's anymore. diff --git a/lib/mangle.c b/lib/mangle.c index 27fd6190..6008d3bf 100644 --- a/lib/mangle.c +++ b/lib/mangle.c @@ -331,6 +331,7 @@ void mangle_name_83(char *s) /* * First, convert some common Unix extensions to extensions of 3 * characters. If none fits, don't change anything now. + * FIXME: should be in an external file. */ if (strcmp(q = s + strlen(s) - strlen(".tar.gz"), ".tar.gz") == 0) { *q = '\0'; @@ -353,6 +354,18 @@ void mangle_name_83(char *s) } else if (strcmp(q = s + strlen(s) - strlen(".mpeg"), ".mpeg") == 0) { *q = '\0'; q = (char *)"mpg"; + } else if (strcmp(q = s + strlen(s) - strlen(".smil"), ".smil") == 0) { + *q = '\0'; + q = (char *)"smi"; + } else if (strcmp(q = s + strlen(s) - strlen(".perl"), ".perl") == 0) { + *q = '\0'; + q = (char *)"pl"; + } else if (strcmp(q = s + strlen(s) - strlen(".jpeg"), ".jpeg") == 0) { + *q = '\0'; + q = (char *)"jpg"; + } else if (strcmp(q = s + strlen(s) - strlen(".tiff"), ".tiff") == 0) { + *q = '\0'; + q = (char *)"tif"; } else { q = NULL; }