--- a/engine/src/ShowEngine.cpp Sun Oct 24 01:27:31 2010 +0100
+++ b/engine/src/ShowEngine.cpp Mon Oct 25 14:03:07 2010 +0100
@@ -190,13 +190,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);