ttroff: avoid crash if home == NULL - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 6530d37d7f3f6d00527a71ba8a02c536c28b5d9f
(DIR) parent 7351eea28ed2d396ca524bb0164501aaca857e8f
(HTM) Author: Russ Cox <rsc@swtch.com>
Date: Sun, 27 Dec 2009 09:22:43 -0800
ttroff: avoid crash if home == NULL
R=rsc
http://codereview.appspot.com/181070
Diffstat:
M src/cmd/troff/dwbinit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/src/cmd/troff/dwbinit.c b/src/cmd/troff/dwbinit.c
t@@ -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 */