diff options
| author | christos <christos@NetBSD.org> | 2010-01-20 01:15:52 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2010-01-20 01:15:52 +0000 |
| commit | 6fbbcd94ce43e80bd3bf1405127196a28d89d8fa (patch) | |
| tree | 366a9d7b513f731334a5fedcbdd1b00288933890 /lib/libedit | |
| parent | fdeb8142705cedfac744cbe268ec7045b70310fe (diff) | |
PR/42646: Joachim Kuebart: Shell crashes in libedit when window size changes
(SIGWINCH). Return NULL if el_gets() gets interrupted.
Diffstat (limited to 'lib/libedit')
| -rw-r--r-- | lib/libedit/eln.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libedit/eln.c b/lib/libedit/eln.c index 572750827a8..c79cdf6962c 100644 --- a/lib/libedit/eln.c +++ b/lib/libedit/eln.c @@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.5 2010/01/19 22:38:08 christos Exp $ */ +/* $NetBSD: eln.c,v 1.6 2010/01/20 01:15:52 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.5 2010/01/19 22:38:08 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.6 2010/01/20 01:15:52 christos Exp $"); #endif /* not lint && not SCCSID */ #include "histedit.h" @@ -72,10 +72,12 @@ el_push(EditLine *el, const char *str) public const char * el_gets(EditLine *el, int *nread) { + const wchar_t *tmp; + el->el_flags |= IGNORE_EXTCHARS; - el_wgets(el, nread); + tmp = el_wgets(el, nread); el->el_flags &= ~IGNORE_EXTCHARS; - return ct_encode_string(el->el_line.buffer, &el->el_lgcyconv); + return ct_encode_string(tmp, &el->el_lgcyconv); } |
