diff options
Diffstat (limited to 'usr/src/lib/libshell/common/edit/emacs.c')
-rw-r--r-- | usr/src/lib/libshell/common/edit/emacs.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/lib/libshell/common/edit/emacs.c b/usr/src/lib/libshell/common/edit/emacs.c index 02842994ab..8faf4c7856 100644 --- a/usr/src/lib/libshell/common/edit/emacs.c +++ b/usr/src/lib/libshell/common/edit/emacs.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1982-2008 AT&T Intellectual Property * +* Copyright (c) 1982-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -62,10 +62,11 @@ One line screen editor for any program */ #include <ast.h> -#include <ctype.h> #include "FEATURE/cmds" #if KSHELL # include "defs.h" +#else +# include <ctype.h> #endif /* KSHELL */ #include "io.h" @@ -207,7 +208,9 @@ int ed_emacsread(void *context, int fd,char *buff,int scend, int reedit) ed_setup(ep->ed,fd,reedit); out = (genchar*)buff; #if SHOPT_MULTIBYTE - out = (genchar*)roundof((char*)out-(char*)0,sizeof(genchar)); + out = (genchar*)roundof(buff-(char*)0,sizeof(genchar)); + if(reedit) + ed_internal(buff,out); #endif /* SHOPT_MULTIBYTE */ if(!kstack) { @@ -907,13 +910,11 @@ static int escape(register Emacs_t* ep,register genchar *out,int count) char buf[MAXLINE]; char *ptr; ptr = hist_word(buf,MAXLINE,(count?count:-1)); -#if !KSHELL if(ptr==0) { beep(); break; } -#endif /* KSHELL */ if ((eol - cur) >= sizeof(name)) { beep(); @@ -1072,6 +1073,7 @@ static int escape(register Emacs_t* ep,register genchar *out,int count) beep(); return(-1); } + return(-1); } |