components/ksh93/patches/180-Bug15808407.patch
author Norm Jacobs <Norm.Jacobs@Oracle.COM>
Tue, 05 May 2015 06:49:34 -0500
changeset 4253 d6f30e77062b
parent 4196 d697072a92f5
permissions -rw-r--r--
21032971 pycparser license generation should have .prep dependency

--- a/src/cmd/ksh93/sh/init.c	2013-01-28 01:37:27.339300867 -0800
+++ b/src/cmd/ksh93/sh/init.c	2013-01-28 01:39:31.614342117 -0800
@@ -278,8 +278,11 @@
 static void put_history(register Namval_t* np,const char *val,int flags,Namfun_t *fp)
 {
 	Shell_t *shp = nv_shell(np);
-	void 	*histopen = shp->gd->hist_ptr;
+	void 	*histopen = NULL;
 	char	*cp;
+	if( shp ) { 
+	    histopen = shp->gd->hist_ptr; 
+	}
 	if(val && histopen)
 	{
 		if(np==HISTFILE && (cp=nv_getval(np)) && strcmp(val,cp)==0)