filemanager/Engine/src/CFileManagerEngine.cpp
branchRCL_3
changeset 19 5181328fad28
parent 12 60626d494346
child 20 efe289f793e7
--- a/filemanager/Engine/src/CFileManagerEngine.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/Engine/src/CFileManagerEngine.cpp	Tue May 11 16:01:48 2010 +0300
@@ -859,14 +859,16 @@
     const TUint16 KMinAllowedChar = 0x0020;
     const TUint16 KParagraphSeparator = 0x2029;
     const TUint16 KDot = '.';
-    TInt nameLen( aName.Length() );
+    TFileName nameAfterTrim( aName );
+    nameAfterTrim.TrimRight(); 
+    TInt nameLen( nameAfterTrim.Length() );
     if ( !nameLen )
         {
         return EFalse;
         }
     for ( TInt i( 0 ); i < nameLen; i++ )
         {
-        TUint16 ch( aName[ i ] );
+        TUint16 ch( nameAfterTrim[ i ] );
         if ( ch < KMinAllowedChar || ch == KParagraphSeparator )
             {
             return EFalse;
@@ -874,7 +876,7 @@
         }
     // File system ignores totally dot in the end of name, so 
     // we set here as not valid name, so that user gets correctly informed
-    if ( aName[ nameLen - 1 ] == KDot || IllegalChars( aName ) )
+    if ( nameAfterTrim[ nameLen - 1 ] == KDot || IllegalChars( nameAfterTrim ) )
         {
         return EFalse;
         }
@@ -907,7 +909,7 @@
             TPtr ptr( fullPath->Des() );
             ptr.Copy( pathPtr );
             CFileManagerUtils::EnsureFinalBackslash( ptr ); // Add backslash before name
-            ptr.Append( aName );
+            ptr.Append( nameAfterTrim );
             ret = iFs.IsValidName( ptr );
             delete fullPath;
             }