diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2004-06-07 05:29:42 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2004-06-07 05:29:42 +0000 |
commit | 7161125e1df06b71c2f1910d2c4930c413e5c622 (patch) | |
tree | 06c5662500c87a95573b968ba8524fd322a0de87 | |
parent | 118d371e290325ff57285253ba912688f680fff9 (diff) | |
download | mdk-7161125e1df06b71c2f1910d2c4930c413e5c622.tar.gz mdk-7161125e1df06b71c2f1910d2c4930c413e5c622.tar.bz2 |
save correctly prompts ending in whitespace.
do not save command line options when -r is passed to mixvm.
-rw-r--r-- | mixutils/mixvm_loop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mixutils/mixvm_loop.c b/mixutils/mixvm_loop.c index dd37bc6..492ebc6 100644 --- a/mixutils/mixvm_loop.c +++ b/mixutils/mixvm_loop.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixvm_loop.c : * Implementation of mix vm command loop. * ------------------------------------------------------------------ - * $Id: mixvm_loop.c,v 1.11 2004/06/07 05:05:27 jao Exp $ + * $Id: mixvm_loop.c,v 1.12 2004/06/07 05:29:42 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. * @@ -117,10 +117,9 @@ mix_vmloop_set_prompt (const gchar *prompt) if (prompt) { if (PROMPT) g_free (PROMPT); - if (prompt[0] == '"') prompt++; - PROMPT = g_strdup (prompt); + PROMPT = g_strdup ((prompt[0] == '"') ? prompt + 1 : prompt); if (PROMPT[strlen (PROMPT) - 1] == '"') PROMPT[strlen (PROMPT) - 1] = 0; - mix_config_update (config_, PROMPT_KEY_, PROMPT); + mix_config_update (config_, PROMPT_KEY_, prompt); } } |