Module Name: src Committed By: kre Date: Fri Jul 5 02:24:57 UTC 2024
Modified Files: src/bin/sh: histedit.c Log Message: Ignore non-numeric values for HISTSIZE This is a temporary change (which can be pulled up to -9 and -10) to avoid having HISTSIZE=foo /bin/sh cause sh to fail to start. A better change, but one requiring far more code changes, so that bad HISTSIZE is ignored, only when read from the environment, but will be an error otherwise, will come later. XXX pullup -9, -10 To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/bin/sh/histedit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/sh/histedit.c diff -u src/bin/sh/histedit.c:1.67 src/bin/sh/histedit.c:1.68 --- src/bin/sh/histedit.c:1.67 Wed Jul 3 05:58:05 2024 +++ src/bin/sh/histedit.c Fri Jul 5 02:24:57 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: histedit.c,v 1.67 2024/07/03 05:58:05 kre Exp $ */ +/* $NetBSD: histedit.c,v 1.68 2024/07/05 02:24:57 kre Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: histedit.c,v 1.67 2024/07/03 05:58:05 kre Exp $"); +__RCSID("$NetBSD: histedit.c,v 1.68 2024/07/05 02:24:57 kre Exp $"); #endif #endif /* not lint */ @@ -249,7 +249,7 @@ sethistsize(const char *hs) HistEvent he; if (hist != NULL) { - if (hs == NULL || *hs == '\0' || *hs == '-' || + if (hs == NULL || *hs == '\0' || !is_number(hs) || (histsize = number(hs)) < 0) histsize = 100; INTOFF;