From 510108dbec0aaf99b5dc45924e7a7d875d138f71 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 14 Sep 1999 14:34:58 +0000 Subject: [PATCH] Fix a coredump when commands in ~/.exrc prepended with addresses. PR: 13000 --- contrib/nvi/ex/ex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/nvi/ex/ex.c b/contrib/nvi/ex/ex.c index f92d8f7c4f9a..ecdae4b86934 100644 --- a/contrib/nvi/ex/ex.c +++ b/contrib/nvi/ex/ex.c @@ -7,6 +7,8 @@ * See the LICENSE file for redistribution information. */ +/* $FreeBSD$ */ + #include "config.h" #ifndef lint @@ -2307,7 +2309,7 @@ ex_badaddr(sp, cp, ba, nret) * underlying file, that's the real problem. */ if (sp->ep == NULL) { - ex_emsg(sp, cp->name, EXM_NOFILEYET); + ex_emsg(sp, cp ? cp->name : NULL, EXM_NOFILEYET); return; }