]> granicus.if.org Git - php/commitdiff
removed a loop
authorkrakjoe <joe.watkins@live.co.uk>
Tue, 19 Nov 2013 13:22:46 +0000 (13:22 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Tue, 19 Nov 2013 13:22:46 +0000 (13:22 +0000)
phpdbg_prompt.c

index 92e39ec2cfc43e091b8dd4f4ea29d3e8216773e5..4095f3c29843324e062c4aff29093d1ed9f631ea 100644 (file)
@@ -970,25 +970,33 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */
        phpdbg_input_t* input = phpdbg_read_input(TSRMLS_C);
        
        if (input) {
-               switch (ret = phpdbg_do_cmd(phpdbg_prompt_commands, input->string, input->length TSRMLS_CC)) {
-                       case FAILURE:
-                               if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
-                                       if (phpdbg_call_register(input TSRMLS_CC) == FAILURE) {
-                                               phpdbg_error("Failed to execute %s!", input->string);
+               do {
+                       switch (ret = phpdbg_do_cmd(phpdbg_prompt_commands, input->string, input->length TSRMLS_CC)) {
+                               case FAILURE:
+                                       if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
+                                               if (phpdbg_call_register(input TSRMLS_CC) == FAILURE) {
+                                                       phpdbg_error("Failed to execute %s!", input->string);
+                                               }
                                        }
-                               }
-                       break;
+                               break;
 
-                       case PHPDBG_LEAVE:
-                       case PHPDBG_FINISH:
-                       case PHPDBG_UNTIL:
-                       case PHPDBG_NEXT: {
-                               if (!EG(in_execution)) {
-                                       phpdbg_error("Not running");
+                               case PHPDBG_LEAVE:
+                               case PHPDBG_FINISH:
+                               case PHPDBG_UNTIL:
+                               case PHPDBG_NEXT: {
+                                       if (!EG(in_execution)) {
+                                               phpdbg_error("Not running");
+                                       }
+                                       goto out;
                                }
-                               goto out;
                        }
-               }
+                       
+                       if (input->string) {
+                               efree(input->string);
+                       }
+                       efree(input);
+                                               
+               } while ((input = phpdbg_read_input(TSRMLS_C)));
        } else {
                if (PHPDBG_G(lcmd)) {
                        ret = PHPDBG_G(lcmd)->handler(