[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] poke: copy-pasteable prompt
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH] poke: copy-pasteable prompt |
Date: |
Wed, 16 Mar 2022 23:09:39 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi apache2.
Thanks for the patch.
> diff --git a/poke/pk-cmd-editor.c b/poke/pk-cmd-editor.c
> index d477e256..f98a7071 100644
> --- a/poke/pk-cmd-editor.c
> +++ b/poke/pk-cmd-editor.c
> @@ -29,6 +29,7 @@
> #include "poke.h"
> #include "pk-cmd.h"
> #include "pk-utils.h"
> +#include "pk-repl.h"
>
> #ifndef PATH_MAX /* GNU/Hurd */
> # define PATH_MAX (64 * 1024)
> @@ -122,7 +123,9 @@ pk_cmd_editor (int argc, struct pk_cmd_arg argv[],
> uint64_t uflags)
>
> if (*newline != '\0')
> {
> - pk_puts ("(poke) ");
> + char *prompt = pk_prompt();
> + pk_puts (prompt);
> + free(prompt);
> pk_puts (newline);
> pk_puts ("\n");
> pk_cmd_exec (newline);
> diff --git a/poke/pk-repl.c b/poke/pk-repl.c
> index 50c06095..4830d18b 100644
> --- a/poke/pk-repl.c
> +++ b/poke/pk-repl.c
> @@ -274,7 +274,7 @@ escape_metacharacters (char *text, int match_type, char
> *qp)
> return s;
> }
>
> -static char *
> +char *
> pk_prompt (void)
> {
> char *prompt = "";
Wouldn't you need to add a prototype for pk_prompt in pk-repl.h?