From d4cb2a0028d6a3ac5fe608e415eb4d40b91dc1dd Mon Sep 17 00:00:00 2001 From: sabetts Date: Tue, 5 Oct 2004 17:36:33 +0000 Subject: (cmd_version): add the build date and time. (cmd_fselect): in interactive mode, return 'abort' when the user aborts, the frame number when they select one, or 'No such frame' when they selected a nonexistent one. (cmd_version): return the version string in non-interactive mode. --- src/actions.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index 3278374..84ba3b5 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1095,8 +1095,15 @@ cmd_kill (int interactive, char *data) char * cmd_version (int interactive, char *data) { - message (" " PACKAGE " " VERSION " "); - return NULL; + if (interactive) + { + message (" " PACKAGE " " VERSION " (built " __DATE__ " " __TIME__ ") "); + return NULL; + } + else + { + return strdup (PACKAGE " " VERSION " (built " __DATE__ " " __TIME__ ")"); + } } char * @@ -3462,11 +3469,11 @@ cmd_fselect (int interactive, char *data) { fnum = frame_selector_match (keysym_buf[0]); if (fnum == -1) - return NULL; + return xstrdup ("abort"); } else { - return NULL; + return xstrdup ("abort"); } } @@ -3474,11 +3481,24 @@ cmd_fselect (int interactive, char *data) it. */ frame = find_frame_number (fnum); if (frame) - set_active_frame (frame); - else - marked_message_printf (0, 0, " fselect: No such frame (%d) ", fnum); + { + char *s; + struct sbuf *sb; - return NULL; + /* Return the frame number that was selected. */ + sb = sbuf_new(0); + sbuf_printf (sb, "%d", fnum); + s = sbuf_get(sb); + free (sb); + + set_active_frame (frame); + return s; + } + else + { + marked_message_printf (0, 0, " fselect: No such frame (%d) ", fnum); + return xstrdup ("No such frame"); + } } char * -- cgit v1.2.3