--- a/engine/src/ShowEngine.cpp Mon Oct 25 13:58:51 2010 +0100
+++ b/engine/src/ShowEngine.cpp Mon Oct 25 14:03:07 2010 +0100
@@ -198,13 +198,25 @@
TFileName fileName;
PodcastUtils::FileNameFromUrl(info->Url(), fileName);
- TFileName extension;
- extension.Copy(fileName.Mid(fileName.LocateReverse('.')));
- DP1("extension=%S", &extension);
-
TFileName newFilename;
- newFilename.Format(_L("%u%S"), info->Uid(), &extension);
- DP1("newFilename=%S", &newFilename);
+
+ TInt periodPos = fileName.LocateReverse('.');
+
+ if (periodPos != -1)
+ {
+ // file extension (most likely) found
+ TFileName extension;
+ extension.Copy(fileName.Mid(periodPos));
+ DP1("extension=%S", &extension);
+
+ newFilename.Format(_L("%u%S"), info->Uid(), &extension);
+ DP1("newFilename=%S", &newFilename);
+ }
+ else
+ {
+ // no extension found, we'll have to rely on magic numbers
+ newFilename.Copy(fileName);
+ }
relPath.Append(newFilename);
PodcastUtils::EnsureProperPathName(relPath);