summaryrefslogtreecommitdiffstats
path: root/bin/sh/histedit.c
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1996-12-14 06:20:03 +0000
committersteve <steve@FreeBSD.org>1996-12-14 06:20:03 +0000
commitc58aca035e2c61510b619368861598623eb95e52 (patch)
tree049d84189a59de29d49254b609a318b17ee59387 /bin/sh/histedit.c
parenta958416f1b4a022c358b94db0b8e6bcc6cb54ee0 (diff)
downloadFreeBSD-src-c58aca035e2c61510b619368861598623eb95e52.zip
FreeBSD-src-c58aca035e2c61510b619368861598623eb95e52.tar.gz
Merge in NetBSD mods and -Wall cleaning.
Obtained from: NetBSD, me
Diffstat (limited to 'bin/sh/histedit.c')
-rw-r--r--bin/sh/histedit.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
index 6d5e280..8f40d97 100644
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -33,11 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: histedit.c,v 1.5 1996/09/01 10:20:12 peter Exp $
+ * $Id: histedit.c,v 1.6 1996/09/03 13:35:09 peter Exp $
*/
#ifndef lint
-static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
+static char const sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
#endif /* not lint */
#include <sys/param.h>
@@ -77,7 +77,7 @@ STATIC char *fc_replace __P((const char *, char *, char *));
* have changed (figures out what to do).
*/
void
-histedit()
+histedit()
{
#define editing (Eflag || Vflag)
@@ -92,7 +92,7 @@ histedit()
INTON;
if (hist != NULL)
- sethistsize();
+ sethistsize(histsizeval());
else
out2str("sh: can't initialize history\n");
}
@@ -145,15 +145,14 @@ bad:
void
-sethistsize()
+sethistsize(hs)
+ const char *hs;
{
- char *cp;
int histsize;
if (hist != NULL) {
- cp = lookupvar("HISTSIZE");
- if (cp == NULL || *cp == '\0' ||
- (histsize = atoi(cp)) < 0)
+ if (hs == NULL || *hs == '\0' ||
+ (histsize = atoi(hs)) < 0)
histsize = 100;
history(hist, H_EVENT, histsize);
}
@@ -418,14 +417,12 @@ fc_replace(s, p, r)
int
not_fcnumber(s)
- char *s;
+ char *s;
{
- if (s == NULL) {
- /* NULL is not a fc_number */
+ if (s == NULL)
return (1);
- }
- if (*s == '-')
- s++;
+ if (*s == '-')
+ s++;
return (!is_number(s));
}
OpenPOWER on IntegriCloud