<rdar://problem/11052829>

Fixed a case where if you have a argument stirng that ends with a '\' character, it would infinite loop while consuming all of your memory.

Also fixed a case where non-quote terminated strings would inefficiently be handled.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152809 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/Args.cpp b/source/Interpreter/Args.cpp
index dfd01ee..99dddda 100644
--- a/source/Interpreter/Args.cpp
+++ b/source/Interpreter/Args.cpp
@@ -225,6 +225,7 @@
                     {
                         case '\0':
                             arg.append (arg_piece_start);
+                            ++arg_end;
                             arg_complete = true;
                             break;
 
@@ -311,6 +312,13 @@
                             }
                             quote_char = '\0';
                         }
+                        else
+                        {
+                            // Consume the rest of the string as there was no terminating quote
+                            arg.append(arg_piece_start);
+                            arg_end = arg_piece_start + strlen(arg_piece_start);
+                            arg_complete = true;
+                        }
                     }
                     break;