bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

edit-and-execute-command needs to quote $EDITOR


From: jim
Subject: edit-and-execute-command needs to quote $EDITOR
Date: Mon, 28 Oct 2002 22:36:25 -0500

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -O3 
-fomit-frame-pointer -march=i686
uname output: Linux neurosis 2.4.18 #16 Sun Mar 17 02:34:39 EST 2002 i686 
unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        edit-and-execute-command (C-xC-e) needs to quote $EDITOR
        when passing it to fc since it might contain spaces.

Repeat-By:
        $ EDITOR="emacs -nw"
        Then press C-xC-e, and you'll get
        bash: fc: -w: invalid option

Fix:
--- bashline.c.orig     Mon Oct 28 22:29:17 2002
+++ bashline.c  Mon Oct 28 22:29:33 2002
@@ -708,8 +708,8 @@
    command being entered (if no explicit argument is given), otherwise on
    a command from the history file. */
 
-#define VI_EDIT_COMMAND                "fc -e ${VISUAL:-${EDITOR:-vi}}"
-#define EMACS_EDIT_COMMAND     "fc -e ${VISUAL:-${EDITOR:-emacs}}"
+#define VI_EDIT_COMMAND                "fc -e \"${VISUAL:-${EDITOR:-vi}}\""
+#define EMACS_EDIT_COMMAND     "fc -e \"${VISUAL:-${EDITOR:-emacs}}\""
 
 static int
 edit_and_execute_command (count, c, editing_mode, edit_command)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]