summaryrefslogtreecommitdiffhomepage
path: root/mixutils/mixvm_command.c
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-09-01 00:19:50 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-09-01 00:19:50 +0000
commit885c5a72026f8b242f3ad3dae0b3a3b8fb78ca16 (patch)
tree59ff2dd480e2844321d509b9488ed9e38cad469f /mixutils/mixvm_command.c
parente6e5c41e0cb0b70652421e778e839543c3fffe7a (diff)
downloadmdk-885c5a72026f8b242f3ad3dae0b3a3b8fb78ca16.tar.gz
mdk-885c5a72026f8b242f3ad3dae0b3a3b8fb78ca16.tar.bz2
new commands: pddir, sddir, ptime, psrc, pprog, pline
Diffstat (limited to 'mixutils/mixvm_command.c')
-rw-r--r--mixutils/mixvm_command.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mixutils/mixvm_command.c b/mixutils/mixvm_command.c
index 4e9d9f8..0818abe 100644
--- a/mixutils/mixvm_command.c
+++ b/mixutils/mixvm_command.c
@@ -64,6 +64,7 @@ try_guile_ (char *line)
/* mixvm dispatcher */
static mix_vm_cmd_dispatcher_t *dis_ = NULL;
+static mix_config_t *config_ = NULL;
/* The names of functions that actually do the manipulation. */
#define DEC_FUN(name) \
@@ -158,8 +159,8 @@ static int
cmd_quit_ (mix_vm_cmd_dispatcher_t *dis, const char *arg)
{
puts ("Quitting ...");
- if ( dis_ ) mix_vm_cmd_dispatcher_delete (dis_);
-
+ if (dis_) mix_vm_cmd_dispatcher_delete (dis_);
+ if (config_) mix_config_delete (config_);
exit (0);
/* pek: anything needed here to make the marker disappear??? */
@@ -211,7 +212,8 @@ mixvm_cmd_init (mix_config_t *config, char *arg, gboolean use_emacs)
#endif /* HAVE_LIBREADLINE */
/* initialise the dispatcher */
- dis_ = mix_vm_cmd_dispatcher_new_with_config (stdout, stderr, config);
+ config_ = config;
+ dis_ = mix_vm_cmd_dispatcher_new_with_config (stdout, stderr, config_);
if ( dis_ == NULL)
g_error (_("Failed initialisation (no memory resources)"));
@@ -247,7 +249,9 @@ mixvm_cmd_exec (char *line)
/* strip white space */
line = g_strstrip(line);
-
+
+ if (strlen (line) == 0) return TRUE;
+
if (try_guile_ (line)) return TRUE;
(void)mix_vm_cmd_dispatcher_dispatch_text (dis_, line);