commit 6530d37d7f3f6d00527a71ba8a02c536c28b5d9f
parent 7351eea28ed2d396ca524bb0164501aaca857e8f
Author: Russ Cox <rsc@swtch.com>
Date: Sun, 27 Dec 2009 09:22:43 -0800
troff: avoid crash if home == NULL
R=rsc
http://codereview.appspot.com/181070
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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 */