aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmdline.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-15 01:57:19 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-15 01:57:19 +0100
commit448aa394b9e7cec855873ad888b9c1ac97a8c68a (patch)
tree051a5bde8b4789013c50d723608929ff3307e935 /cmdline.cpp
parent905e69b74fe6e822e0d00245e2c210e9aadb6437 (diff)
downloadsciteco-448aa394b9e7cec855873ad888b9c1ac97a8c68a.tar.gz
cleaned up command line updating: the interface is responsible for drawing the "*" (if it wants to)
Diffstat (limited to 'cmdline.cpp')
-rw-r--r--cmdline.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/cmdline.cpp b/cmdline.cpp
index 557e056..31badb5 100644
--- a/cmdline.cpp
+++ b/cmdline.cpp
@@ -13,7 +13,7 @@
#include "undo.h"
static inline const gchar *process_edit_cmd(gchar key);
-static gchar *macro_echo(const gchar *macro, const gchar *prefix = "");
+static gchar *macro_echo(const gchar *macro);
static gchar *filename_complete(const gchar *filename, gchar completed = ' ');
static const gchar *last_occurrence(const gchar *str,
@@ -65,7 +65,7 @@ cmdline_keypress(gchar key)
/*
* Echo command line
*/
- echo = macro_echo(cmdline, "*");
+ echo = macro_echo(cmdline);
interface.cmdline_update(echo);
g_free(echo);
}
@@ -135,15 +135,14 @@ process_edit_cmd(gchar key)
}
static gchar *
-macro_echo(const gchar *macro, const gchar *prefix)
+macro_echo(const gchar *macro)
{
gchar *result, *rp;
if (!macro)
- return g_strdup(prefix);
+ return g_strdup("");
- result = (gchar *)g_malloc(strlen(prefix) + strlen(macro)*5 + 1);
- rp = g_stpcpy(result, prefix);
+ rp = result = (gchar *)g_malloc(strlen(macro)*5 + 1);
for (const gchar *p = macro; *p; p++) {
switch (*p) {