diff options
| author | lukem <lukem@NetBSD.org> | 1997-01-11 06:26:30 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 1997-01-11 06:26:30 +0000 |
| commit | 258ebfd2683e2335de032bd5d7060e888b5a6ff8 (patch) | |
| tree | 202ca3946f8fc066f102fbd43b263e503acbc783 /lib/libedit | |
| parent | 35b9d065965dff0c1316a87bc5d5e5eb204f583f (diff) | |
* in el_parse(), don't reference argv[0] if argc < 1 (return -1 instead)
* clarify return value of el_parse()
Diffstat (limited to 'lib/libedit')
| -rw-r--r-- | lib/libedit/editline.3 | 12 | ||||
| -rw-r--r-- | lib/libedit/parse.c | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/libedit/editline.3 b/lib/libedit/editline.3 index 5ccbbcec071..07467471f88 100644 --- a/lib/libedit/editline.3 +++ b/lib/libedit/editline.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.1 1997/01/09 13:12:15 lukem Exp $ +.\" $NetBSD: editline.3,v 1.2 1997/01/11 06:26:30 lukem Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -178,10 +178,12 @@ matches the .Fa prog argument supplied to .Fn el_init . -The return value is -1 if the command is unknown, 0 if there was no -error or +The return value is +-1 if the command is unknown, +0 if there was no error or .Dq prog -didn't match, or 1 if the command returned an error. +didn't match, or +1 if the command returned an error. Refer to .Xr editrc 5 for more information. @@ -509,7 +511,7 @@ Save the history list to The .Nm library first appeared in -.Os NetBSD 1.0 . +.Nx 1.0 . .Sh AUTHORS The .Nm diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c index 115f84b0caf..ffe40ed386b 100644 --- a/lib/libedit/parse.c +++ b/lib/libedit/parse.c @@ -97,6 +97,8 @@ el_parse(el, argc, argv) char *ptr; int i; + if (argc < 1) + return -1; ptr = strchr(argv[0], ':'); if (ptr != NULL) { *ptr++ = '\0'; |
