From 6530d37d7f3f6d00527a71ba8a02c536c28b5d9f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 27 Dec 2009 09:22:43 -0800 Subject: troff: avoid crash if home == NULL R=rsc http://codereview.appspot.com/181070 --- src/cmd/troff/dwbinit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cmd/troff') diff --git a/src/cmd/troff/dwbinit.c b/src/cmd/troff/dwbinit.c index 9c1845b0..064a0b02 100644 --- a/src/cmd/troff/dwbinit.c +++ b/src/cmd/troff/dwbinit.c @@ -189,7 +189,8 @@ char *DWBhome(void) if ( (home = DWBHOME) == NULL || *home == '\0' || *home == ' ' ) home = NULL; } /* End if */ - home = unsharp(home); + if ( home != NULL ) + home = unsharp(home); } /* End if */ while (home && *home == '/' && *(home +1) == '/') /* remove extra slashes */ -- cgit v1.2.3