Skip to content

Commit a3f2137

Browse files
committed
...
1 parent b63fd6d commit a3f2137

File tree

2 files changed

+1
-63
lines changed

2 files changed

+1
-63
lines changed

phpdbg_prompt.c

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -73,71 +73,10 @@ static const phpdbg_command_t phpdbg_prompt_commands[] = {
7373

7474
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
7575

76-
int phpdbg_confirm(char *message TSRMLS_DC)
77-
{
78-
char cmd[PHPDBG_MAX_CMD];
79-
80-
zend_bool confirmed = 0,
81-
result = 0;
82-
83-
phpdbg_writeln(message);
84-
85-
do {
86-
phpdbg_error("Confirm (y or n) ?");
87-
88-
if ((fgets(cmd, PHPDBG_MAX_CMD, stdin) != NULL)) {
89-
switch (cmd[0]) {
90-
case 'y':
91-
case 'Y': {
92-
result = 1;
93-
confirmed = 1;
94-
} break;
95-
96-
case 'n':
97-
case 'N': {
98-
confirmed = 1;
99-
} break;
100-
}
101-
}
102-
} while (!confirmed);
103-
104-
return result;
105-
}
106-
107-
void phpdbg_sigint_handler(int signum)
108-
{
109-
TSRMLS_FETCH();
110-
111-
phpdbg_writeln(EMPTY);
112-
113-
signal(signum, SIG_IGN);
114-
115-
if (EG(in_execution)) {
116-
if (phpdbg_confirm(
117-
"Do you really want to quit while executing ?" TSRMLS_CC)) {
118-
PHPDBG_G(flags) |= PHPDBG_IS_QUITTING;
119-
120-
zend_bailout();
121-
} else {
122-
signal(
123-
SIGINT, phpdbg_sigint_handler);
124-
phpdbg_interactive(TSRMLS_C);
125-
}
126-
} else {
127-
phpdbg_notice("Interrupted ...");
128-
129-
PHPDBG_G(flags) = PHPDBG_IS_QUITTING;
130-
131-
zend_bailout();
132-
}
133-
}
134-
13576
void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC) /* {{{ */
13677
{
13778
zend_bool init_default = 0;
138-
139-
signal(SIGINT, phpdbg_sigint_handler);
140-
79+
14180
if (!init_file && use_default) {
14281
struct stat sb;
14382

phpdbg_prompt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_le
6363

6464
void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC);
6565
void phpdbg_welcome(zend_bool cleaning TSRMLS_DC);
66-
int phpdbg_confirm(char *message TSRMLS_DC);
6766
int phpdbg_interactive(TSRMLS_D);
6867
void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC);
6968
void phpdbg_clean(zend_bool full TSRMLS_DC);

0 commit comments

Comments
 (0)