Skip to content

Commit 95a24d1

Browse files
committed
Update patches
1 parent bcbf86c commit 95a24d1

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

patches/8.3/phpdbg-prompt.patch

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ Subject: Fix phpdbg prompt with editline/readline integration
22

33
When building phpdbg SAPI with libedit/readline integration, also start
44
and end ignore characters need to be added in the prompt pattern. This
5-
should work now for libedit, readline, and phpdbg without
6-
readline/libedit.
5+
should work for libedit, readline, and phpdbg without readline/libedit.
76

87
The RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE macros are checked
9-
there to ensure libedit has these available. Otherwise, this could be
10-
further improved by concatenating strings and literal strings into
11-
single argument or similar using these two symbols directly.
8+
to ensure libedit has these available. Otherwise, this could be further
9+
improved by concatenating strings and literal strings into single
10+
argument or similar using these two symbols directly.
1211

1312
Autotools:
1413

@@ -29,7 +28,7 @@ terminals.
2928
1 file changed, 7 insertions(+), 3 deletions(-)
3029

3130
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
32-
index 964d82ef6c..4ade8777bb 100644
31+
index 964d82ef6c..944db08188 100644
3332
--- a/sapi/phpdbg/phpdbg_utils.c
3433
+++ b/sapi/phpdbg/phpdbg_utils.c
3534
@@ -318,10 +318,14 @@ PHPDBG_API const char *phpdbg_get_prompt(void) /* {{{ */
@@ -40,13 +39,13 @@ index 964d82ef6c..4ade8777bb 100644
4039
- /* TODO: libedit doesn't seems to support coloured prompt */
4140
+#if !defined(HAVE_LIBEDIT) || (defined(HAVE_LIBEDIT) && defined(RL_PROMPT_START_IGNORE) && defined(RL_PROMPT_END_IGNORE))
4241
+# if defined(HAVE_LIBEDIT) && defined(RL_PROMPT_START_IGNORE) && defined(RL_PROMPT_END_IGNORE)
43-
+# define PHPDBG_PROMPT "\1\033[%sm\2%s\1\033[0m\2 "
42+
+# define PHPDBG_PROMPT_FORMAT "\1\033[%sm\2%s\1\033[0m\2 "
4443
+# else
45-
+# define PHPDBG_PROMPT "\033[%sm%s\033[0m "
44+
+# define PHPDBG_PROMPT_FORMAT "\033[%sm%s\033[0m "
4645
+# endif
4746
if ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED)) {
4847
- ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], "\033[%sm%s\033[0m ",
49-
+ ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], PHPDBG_PROMPT,
48+
+ ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], PHPDBG_PROMPT_FORMAT,
5049
PHPDBG_G(colors)[PHPDBG_COLOR_PROMPT]->code,
5150
PHPDBG_G(prompt)[0]));
5251
} else

patches/8.4/phpdbg-prompt.patch

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ Subject: Fix phpdbg prompt with editline/readline integration
22

33
When building phpdbg SAPI with libedit/readline integration, also start
44
and end ignore characters need to be added in the prompt pattern. This
5-
should work now for libedit, readline, and phpdbg without
6-
readline/libedit.
5+
should work for libedit, readline, and phpdbg without readline/libedit.
76

87
The RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE macros are checked
9-
there to ensure libedit has these available. Otherwise, this could be
10-
further improved by concatenating strings and literal strings into
11-
single argument or similar using these two symbols directly.
8+
to ensure libedit has these available. Otherwise, this could be further
9+
improved by concatenating strings and literal strings into single
10+
argument or similar using these two symbols directly.
1211

1312
Autotools:
1413

@@ -29,7 +28,7 @@ terminals.
2928
1 file changed, 7 insertions(+), 3 deletions(-)
3029

3130
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
32-
index 329ee9a883..1511a75bd0 100644
31+
index 329ee9a883..c2a73d3709 100644
3332
--- a/sapi/phpdbg/phpdbg_utils.c
3433
+++ b/sapi/phpdbg/phpdbg_utils.c
3534
@@ -318,10 +318,14 @@ PHPDBG_API const char *phpdbg_get_prompt(void) /* {{{ */
@@ -40,13 +39,13 @@ index 329ee9a883..1511a75bd0 100644
4039
- /* TODO: libedit doesn't seems to support coloured prompt */
4140
+#if !defined(HAVE_LIBEDIT) || (defined(HAVE_LIBEDIT) && defined(RL_PROMPT_START_IGNORE) && defined(RL_PROMPT_END_IGNORE))
4241
+# if defined(HAVE_LIBEDIT) && defined(RL_PROMPT_START_IGNORE) && defined(RL_PROMPT_END_IGNORE)
43-
+# define PHPDBG_PROMPT "\1\033[%sm\2%s\1\033[0m\2 "
42+
+# define PHPDBG_PROMPT_FORMAT "\1\033[%sm\2%s\1\033[0m\2 "
4443
+# else
45-
+# define PHPDBG_PROMPT "\033[%sm%s\033[0m "
44+
+# define PHPDBG_PROMPT_FORMAT "\033[%sm%s\033[0m "
4645
+# endif
4746
if ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED)) {
4847
- ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], "\033[%sm%s\033[0m ",
49-
+ ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], PHPDBG_PROMPT,
48+
+ ZEND_IGNORE_VALUE(asprintf(&PHPDBG_G(prompt)[1], PHPDBG_PROMPT_FORMAT,
5049
PHPDBG_G(colors)[PHPDBG_COLOR_PROMPT]->code,
5150
PHPDBG_G(prompt)[0]));
5251
} else

0 commit comments

Comments
 (0)