diff options
author | steve <steve@FreeBSD.org> | 1999-11-14 10:53:01 +0800 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1999-11-14 10:53:01 +0800 |
commit | 93b197f3e64f4c1ec503a3979e2b58f0f38c25df (patch) | |
tree | 361872fb3486e469aa72e70c67d4412f3328a4f5 /editors/uemacs | |
parent | 58e50fae8fcc79dd9e7a3e7ac3eef6ba7eb7a2b5 (diff) | |
download | freebsd-ports-gnome-93b197f3e64f4c1ec503a3979e2b58f0f38c25df.tar.gz freebsd-ports-gnome-93b197f3e64f4c1ec503a3979e2b58f0f38c25df.tar.zst freebsd-ports-gnome-93b197f3e64f4c1ec503a3979e2b58f0f38c25df.zip |
Allow the number of lines and columns to be overridden from LINES and
COLUMNS in the user's environment.
PR: 14784
Diffstat (limited to 'editors/uemacs')
-rw-r--r-- | editors/uemacs/files/patch-ag | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/editors/uemacs/files/patch-ag b/editors/uemacs/files/patch-ag new file mode 100644 index 000000000000..b595477251ed --- /dev/null +++ b/editors/uemacs/files/patch-ag @@ -0,0 +1,25 @@ +--- src/unix.c.orig Sat Nov 13 14:57:12 1999 ++++ src/unix.c Sat Nov 13 15:04:45 1999 +@@ -816,9 +816,19 @@ + exit(1); + } + +- /* Get size from termcap */ +- term.t_nrow = tgetnum("li") - 1; +- term.t_ncol = tgetnum("co"); ++ /* ++ * If LINES and/or COLUMNS are set in the environment then use those ++ * values, otherwise get them from termcap. ++ */ ++ if ((cp = getenv("LINES")) == NULL || sscanf(cp, "%d", ++ &term.t_nrow) != 1) ++ term.t_nrow = tgetnum("li"); ++ term.t_nrow -= 1; ++ ++ if ((cp = getenv("COLUMNS")) == NULL || sscanf(cp, "%d", ++ &term.t_ncol) != 1) ++ term.t_ncol = tgetnum("co"); ++ + if (term.t_nrow < 3 || term.t_ncol < 3) { + puts("Screen size is too small!"); + exit(1); |