diff options
author | pfg <pfg@FreeBSD.org> | 2017-02-20 03:33:59 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-02-20 03:33:59 +0000 |
commit | 90692e8243d9334f92182299ee401dc0a90965e2 (patch) | |
tree | d5cbabb64df66f2169ffabac4e42167e5a6ce02b /lib/libedit/tokenizer.c | |
parent | 3c4b6c4becf1f0078e5df17d458c36274d426a68 (diff) | |
download | FreeBSD-src-90692e8243d9334f92182299ee401dc0a90965e2.zip FreeBSD-src-90692e8243d9334f92182299ee401dc0a90965e2.tar.gz |
MFC r312997, r313002:
Re-import libedit 2016-02-27 and update libedit with changes from NetBSD's
2016-03-21.
Obtained from: NetBSD
Diffstat (limited to 'lib/libedit/tokenizer.c')
-rw-r--r-- | lib/libedit/tokenizer.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libedit/tokenizer.c b/lib/libedit/tokenizer.c index f5171c4..23f940f 100644 --- a/lib/libedit/tokenizer.c +++ b/lib/libedit/tokenizer.c @@ -1,4 +1,4 @@ -/* $NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $ */ +/* $NetBSD: tokenizer.c,v 1.24 2016/02/17 19:47:49 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $"); +__RCSID("$NetBSD: tokenizer.c,v 1.24 2016/02/17 19:47:49 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include <sys/cdefs.h> @@ -47,8 +47,9 @@ __FBSDID("$FreeBSD$"); /* * tokenize.c: Bourne shell like tokenizer */ -#include <string.h> #include <stdlib.h> +#include <string.h> + #include "histedit.h" #include "chartype.h" @@ -415,8 +416,10 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line, Char **p; tok->amax += AINCR; p = tok_realloc(tok->argv, tok->amax * sizeof(*p)); - if (p == NULL) + if (p == NULL) { + tok->amax -= AINCR; return -1; + } tok->argv = p; } } |