read_prompt: take prompt 'name' as arg
authorJonas Fonseca <fonseca@diku.dk>
Fri, 8 Sep 2006 16:21:43 +0000 (18:21 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Fri, 8 Sep 2006 16:30:09 +0000 (18:30 +0200)
tig.c

diff --git a/tig.c b/tig.c
index f6532ad..b84c561 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2687,7 +2687,7 @@ init_display(void)
 }
 
 static int
-read_prompt(void)
+read_prompt(const char *prompt)
 {
        enum { READING, STOP, CANCEL } status = READING;
        char buf[sizeof(opt_cmd) - STRING_SIZE("git \0")];
@@ -2700,7 +2700,7 @@ read_prompt(void)
                foreach_view (view, i)
                        update_view(view);
 
-               report(":%.*s", pos, buf);
+               report("%s%.*s", prompt, pos, buf);
                /* Refresh, accept single keystroke of input */
                key = wgetch(status_win);
                switch (key) {
@@ -3010,7 +3010,7 @@ main(int argc, char *argv[])
                 * status_win restricted. */
                switch (request) {
                case REQ_PROMPT:
-                       if (read_prompt() == ERR)
+                       if (read_prompt(":") == ERR)
                                request = REQ_SCREEN_UPDATE;
                        break;