aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/troff
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2009-12-27 09:22:43 -0800
committerRuss Cox <rsc@swtch.com>2009-12-27 09:22:43 -0800
commit6530d37d7f3f6d00527a71ba8a02c536c28b5d9f (patch)
tree8b9d6a92c23a9be4a4c5a7b3d56d5ac92ec4aa94 /src/cmd/troff
parent7351eea28ed2d396ca524bb0164501aaca857e8f (diff)
downloadplan9port-6530d37d7f3f6d00527a71ba8a02c536c28b5d9f.tar.gz
plan9port-6530d37d7f3f6d00527a71ba8a02c536c28b5d9f.tar.bz2
plan9port-6530d37d7f3f6d00527a71ba8a02c536c28b5d9f.zip
troff: avoid crash if home == NULL
R=rsc http://codereview.appspot.com/181070
Diffstat (limited to 'src/cmd/troff')
-rw-r--r--src/cmd/troff/dwbinit.c3
1 files changed, 2 insertions, 1 deletions
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 */