localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp
changeset 38 48c22c726cf9
parent 33 883e91c086aa
--- a/localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp	Tue Jul 06 15:13:34 2010 +0300
+++ b/localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp	Wed Aug 18 10:38:51 2010 +0300
@@ -855,20 +855,6 @@
         FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (more needed) complete") ));
         return ETrue;
         }
-    // As a last step adjust the possible multiple IsDelimiterCharacter()
-    // characters and set length of iLineBuffer. Leave iEndIndex untouched.
-    lineLength = iLineBuffer.Length();
-    for ( TInt i=lineLength-1; i>=0; i-- )
-        {
-        TChar character = iLineBuffer[i];
-        if ( !IsDelimiterCharacter(character) )
-            {
-            iLineBuffer.SetLength( i + 1 );
-            FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() after (%d bytes):"), iLineBuffer.Length() ));
-            FTRACE(FPrintRaw(iLineBuffer) );
-            break;
-            }
-        }
     FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (line found) complete") ));
     return EFalse;
     }
@@ -1413,9 +1399,25 @@
         {
         iDecodeInfo.iExtendedIndex = aEndIndex;
         SaveFoundCharDecodeState( aCharacter );
-        FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border) complete") ));
+        FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border normal) complete") ));
         return EFalse;
         }
+    // Now suspect border found so peek the next character after the suspected
+    // extended character. If it is not alphabetical character, return with EFalse.
+    // This case is to detect the cases such as "AT+VTS={*,3000}", where '*' would
+    // be the start of the next command in normal cases.
+    TInt peekIndex = aEndIndex + 1;
+    TInt lineLength = iLineBuffer.Length();
+    if ( peekIndex < lineLength )
+        {
+        TChar nextCharacter = iLineBuffer[peekIndex];
+        if ( !nextCharacter.IsAlpha() )
+            {
+            SaveFoundCharDecodeState( aCharacter );
+            FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border special) complete") ));
+            return EFalse;
+            }
+        }
     aEndIndex--;
     FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (border) complete") ));
     return ETrue;