* edit.c: when tabcompleting a newline to backslash+newline, this

sequence is eaten before the command is called; cought by <TGEN>
  (Thomas E. Spanjaard) via IRC
  fix is to tabcomplete a newline to singlequote+newline+singlequote
* bump version
This commit is contained in:
tg 2007-02-16 17:46:42 +00:00
parent 1ac25b72dc
commit ad05a2414b
3 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.90 2007/02/07 02:31:06 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.91 2007/02/16 17:46:41 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R29 2007/02/07
@(#)MIRBSD KSH R29 2007/02/16
description:
Check version of shell.
category: pdksh

6
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.81 2007/02/07 02:01:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.82 2007/02/16 17:46:42 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -739,8 +739,10 @@ x_escape(const char *s, size_t len, int (*putbuf_func) (const char *, size_t))
rval = -1;
break;
}
putbuf_func("\\", 1);
putbuf_func(s[add] == '\n' ? "'" : "\\", 1);
putbuf_func(&s[add], 1);
if (s[add] == '\n')
putbuf_func("'", 1);
add++;
wlen -= add;

4
sh.h
View File

@ -8,8 +8,8 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.111 2007/02/07 02:31:06 tg Exp $"
#define MKSH_VERSION "R29 2007/02/07"
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.112 2007/02/16 17:46:42 tg Exp $"
#define MKSH_VERSION "R29 2007/02/16"
#if HAVE_SYS_PARAM_H
#include <sys/param.h>