Only attempt to el_parse() a command unknown by the default parser

if editing is enabled.
Fixes PR bin/38589
This commit is contained in:
lukem 2008-05-05 22:54:11 +00:00
parent 5e40785deb
commit c63ddfd726
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
/* $NetBSD: main.c,v 1.107 2008/04/28 20:24:13 martin Exp $ */
/* $NetBSD: main.c,v 1.108 2008/05/05 22:54:11 lukem Exp $ */
/*-
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
* Copyright (c) 1996-2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@ -97,7 +97,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: main.c,v 1.107 2008/04/28 20:24:13 martin Exp $");
__RCSID("$NetBSD: main.c,v 1.108 2008/05/05 22:54:11 lukem Exp $");
#endif
#endif /* not lint */
@ -722,6 +722,7 @@ cmdscanner(void)
* such commands as invalid.
*/
if (strchr(margv[0], ':') != NULL ||
!editing ||
el_parse(el, margc, (const char **)margv) != 0)
#endif /* !NO_EDITCOMPLETE */
fputs("?Invalid command.\n", ttyout);

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.h,v 1.74 2008/04/28 20:24:13 martin Exp $ */
/* $NetBSD: version.h,v 1.75 2008/05/05 22:54:11 lukem Exp $ */
/*-
* Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
@ -34,5 +34,5 @@
#endif
#ifndef FTP_VERSION
#define FTP_VERSION "20080422"
#define FTP_VERSION "20080505"
#endif