diff options
| author | Mike Pritchard <mpp@FreeBSD.org> | 1997-01-09 14:50:42 +0000 |
|---|---|---|
| committer | Mike Pritchard <mpp@FreeBSD.org> | 1997-01-09 14:50:42 +0000 |
| commit | 00f7ecb490ac9006414f085ce1d53a4940020f98 (patch) | |
| tree | de60edff8d863ba64ab90633e827a9e88fae6c98 /gnu | |
| parent | fbb488e831e68df031194613cb668c8bf0f58b0b (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/man/man/man.c | 11 | ||||
| -rw-r--r-- | gnu/usr.bin/man/man/manpath.c | 17 |
2 files changed, 16 insertions, 12 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c index fdfab5ad973d..4452fc467f8a 100644 --- a/gnu/usr.bin/man/man/man.c +++ b/gnu/usr.bin/man/man/man.c @@ -757,12 +757,12 @@ ultimate_source (name, path) next: if ((fp = fopen (ult, "r")) == NULL) - return buf; - - if (fgets (buf, BUFSIZ, fp) == NULL) return ult; - if (strlen (buf) < 5) + end = fgets (buf, BUFSIZ, fp); + fclose(fp); + + if (!end || strlen (buf) < 5) return ult; beg = buf; @@ -948,6 +948,7 @@ make_roff_command (file) { cp = line; fgets (line, BUFSIZ, fp); + fclose(fp); if (*cp++ == '\'' && *cp++ == '\\' && *cp++ == '"' && *cp++ == ' ') { if (debug) @@ -955,8 +956,6 @@ make_roff_command (file) status = parse_roff_directive (cp, file, buf, sizeof(buf)); - fclose (fp); - if (status == 0) return buf; diff --git a/gnu/usr.bin/man/man/manpath.c b/gnu/usr.bin/man/man/manpath.c index 294ffaf99830..cdc370cd6175 100644 --- a/gnu/usr.bin/man/man/manpath.c +++ b/gnu/usr.bin/man/man/manpath.c @@ -202,9 +202,11 @@ get_dirlist () if (!strncmp ("MANDATORY_MANPATH", bp, 17)) { - if ((p = strchr (bp, ' ')) == NULL) - if ((p = strchr (bp, '\t')) == NULL) - return -1; + if ((p = strchr (bp, ' ')) == NULL && + (p = strchr (bp, '\t')) == NULL) { + fclose(config); + return -1; + } bp = p; @@ -224,9 +226,11 @@ get_dirlist () } else if (!strncmp ("MANPATH_MAP", bp, 11)) { - if ((p = strchr (bp, ' ')) == NULL) - if ((p = strchr (bp, '\t')) == NULL) - return -1; + if ((p = strchr (bp, ' ')) == NULL && + (p = strchr (bp, '\t')) == NULL) { + fclose(config); + return -1; + } bp = p; @@ -259,6 +263,7 @@ get_dirlist () dlp++; } + fclose(config); dlp->bin[0] = '\0'; dlp->mandir[0] = '\0'; dlp->mandatory = 0; |
