diff --git a/scm/troff.scm b/scm/troff.scm index 06f1922..d21b624 100644 --- a/scm/troff.scm +++ b/scm/troff.scm @@ -273,9 +273,9 @@ (loop (read-line)))))) (cond ((string=? delim "##") - (with-output-to-stream '[##] + (with-output-to-stream 'hash-hash (copy-exec ".##\n" "inline Scheme execution")) - (let ((p (open-input-string (stream->string '[##])))) + (let ((p (open-input-string (stream->string 'hash-hash)))) (copy-apply (lambda () (read p)) \##-eval))) ((string=? delim ">>") (copy-exec ".>>\n" "transparent output")) diff --git a/src/error.c b/src/error.c index 7e8318e..2745d00 100644 --- a/src/error.c +++ b/src/error.c @@ -37,10 +37,7 @@ void fatal_error(char *fmt, ...) { exit(1); } -static char *strerr(void) { - extern int sys_nerr; - extern char *sys_errlist[]; - +static const char *strerr(void) { return errno > 0 && errno < sys_nerr ? sys_errlist[errno] : "unknown error"; } diff --git a/src/error.h b/src/error.h index 372a637..36c6991 100644 --- a/src/error.h +++ b/src/error.h @@ -12,9 +12,5 @@ void read_error(char *) NORETURN; void write_error(char *) NORETURN; void open_error(char *) NORETURN; -/* Redefined to add NORETURN - */ -extern Primitive_Error() NORETURN; - char *printable_string(char *, int); char *printable_char(char); diff --git a/src/expr.c b/src/expr.c index 3743531..5da7344 100644 --- a/src/expr.c +++ b/src/expr.c @@ -170,7 +170,7 @@ err: *p = 0; assert(0); } } - if (!finite(acc)) { + if (!isfinite(acc)) { warn("expression evaluates to infinity"); goto err; } return acc; diff --git a/src/unroff.c b/src/unroff.c index dce5c63..50f1d17 100644 --- a/src/unroff.c +++ b/src/unroff.c @@ -154,7 +154,8 @@ int main(int ac, char **av) { directory = DEFAULT_DIR; if ((format = getenv(DEFAULT_FORMAT_ENV)) == 0) format = DEFAULT_FORMAT; - eav = safe_malloc((ac+1+2) * sizeof(char *)); /* ac + -p xxx + 0-ptr */ + /* av[0] "-g", "-p", "xxx", av[1...] NULL */ + eav = safe_malloc((ac+3+1) * sizeof(char *)); eav[0] = av[0]; opterr = 0; while ((c = getopt(ac, av, "h:gm:f:tC")) != EOF) { @@ -180,6 +181,7 @@ int main(int ac, char **av) { return 1; } } + eav[eac++] = "-g"; /* We need symbols to be case-sensitive. */ /* Set the Elk load-path to $(directory)/elk, so that a minimal, * self-contained Elk runtime environment can be shipped with * binary distributions. Sites with a full Elk can symlink diff --git a/src/unroff.h b/src/unroff.h index 40e6611..82d0220 100644 --- a/src/unroff.h +++ b/src/unroff.h @@ -26,18 +26,9 @@ extern long strtol(const char *s, char **endp, int base); extern double strtod(const char *s, char **endp); extern int pclose(FILE *); extern int system(const char *); -#ifndef tolower -extern int tolower(int); -#endif - -/* Prototypes for IEEE FP functions that may be missing: - */ -#ifndef finite -extern int finite(double); -#endif -#include "scheme.h" +#include /* Prototypes that were missing from "scheme.h" in some Elk releases: */