summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/sh.hist.c
diff options
context:
space:
mode:
authormp <mp@FreeBSD.org>2002-07-24 16:23:10 +0000
committermp <mp@FreeBSD.org>2002-07-24 16:23:10 +0000
commitf2c2aa29b7d05c53575ab7ce4dc5870fd33a1310 (patch)
tree22260a5dd95c2612c939ecc9dc8166877f07d1d1 /contrib/tcsh/sh.hist.c
parente8a1e84ed0d35851468ed9942dd757f1874d0907 (diff)
downloadFreeBSD-src-f2c2aa29b7d05c53575ab7ce4dc5870fd33a1310.zip
FreeBSD-src-f2c2aa29b7d05c53575ab7ce4dc5870fd33a1310.tar.gz
Import of tcsh-6.12.00
Diffstat (limited to 'contrib/tcsh/sh.hist.c')
-rw-r--r--contrib/tcsh/sh.hist.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/contrib/tcsh/sh.hist.c b/contrib/tcsh/sh.hist.c
index 639f5e9..96d37ba 100644
--- a/contrib/tcsh/sh.hist.c
+++ b/contrib/tcsh/sh.hist.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.hist.c,v 3.27 2000/06/10 22:07:56 kim Exp $ */
+/* $Header: /src/pub/tcsh/sh.hist.c,v 3.29 2002/06/25 19:02:11 christos Exp $ */
/*
* sh.hist.c: Shell history expansions and substitutions
*/
@@ -14,11 +14,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -36,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.hist.c,v 3.27 2000/06/10 22:07:56 kim Exp $")
+RCSID("$Id: sh.hist.c,v 3.29 2002/06/25 19:02:11 christos Exp $")
#include "tc.h"
@@ -348,7 +344,7 @@ phist(hp, hflg)
Char buf[INBUFSIZE];
struct varent *vp = adrof(STRhistory);
- if (vp && vp->vec[0] && vp->vec[1])
+ if (vp && vp->vec != NULL && vp->vec[0] && vp->vec[1])
cp = vp->vec[1];
tprintf(FMT_HISTORY, buf, cp, INBUFSIZE, NULL, hp->Htime, (ptr_t) hp);
@@ -439,7 +435,7 @@ rechist(fname, ref)
*/
oldidfds = didfds;
didfds = 0;
- if ((shist = adrof(STRsavehist)) != NULL)
+ if ((shist = adrof(STRsavehist)) != NULL && shist->vec != NULL)
if (shist->vec[1] && eq(shist->vec[1], STRmerge))
loadhist(fname, 1);
fp = creat(short2str(fname), 0600);
OpenPOWER on IntegriCloud