unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 08dfbbed84af36b0bc3f89ce85f798995bdeadfc 984 bytes (raw)
name: gnu/packages/patches/nvi-fallback-to-dumb-term.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
This patch originates from the Debian project, see https://www.debian.org/

24fallback_to_dumb_term.dpatch by  <hesso@pool.math.tu-berlin.de>


If there's no $TERM around, just fall back to "dumb".

diff -Naur nvi-1.81.6.orig/cl/cl_main.c nvi-1.81.6/cl/cl_main.c
--- nvi-1.81.6.orig/cl/cl_main.c	2007-11-18 17:41:42.000000000 +0100
+++ nvi-1.81.6/cl/cl_main.c	2008-05-01 18:29:13.000000000 +0200
@@ -96,6 +96,7 @@
 	if ((ttype = getenv("TERM")) == NULL)
 		ttype = "unknown";
 	term_init(gp->progname, ttype);
+	ttype = getenv("TERM");
 
 	/* Add the terminal type to the global structure. */
 	if ((OG_D_STR(gp, GO_TERM) =
@@ -233,6 +234,11 @@
 
 	/* Set up the terminal database information. */
 	setupterm(ttype, STDOUT_FILENO, &err);
+	if (err == 0) {
+		(void)fprintf(stderr, "%s: %s: unknown terminal type, falling back to 'dumb'\n", name, ttype);
+		setenv("TERM", "dumb", 1);
+		setupterm("dumb", STDOUT_FILENO, &err);
+	}
 	switch (err) {
 	case -1:
 		(void)fprintf(stderr,

debug log:

solving 08dfbbe ...
found 08dfbbe in https://yhetil.org/guix-devel/54BE9C68.9070103@gmail.com/

applying [1/1] https://yhetil.org/guix-devel/54BE9C68.9070103@gmail.com/
diff --git a/gnu/packages/patches/nvi-fallback-to-dumb-term.patch b/gnu/packages/patches/nvi-fallback-to-dumb-term.patch
new file mode 100644
index 0000000..08dfbbe

1:18: space before tab in indent.
 	if ((ttype = getenv("TERM")) == NULL)
1:19: space before tab in indent.
 		ttype = "unknown";
1:20: space before tab in indent.
 	term_init(gp->progname, ttype);
1:22: trailing whitespace.
 
1:23: space before tab in indent.
 	/* Add the terminal type to the global structure. */
Checking patch gnu/packages/patches/nvi-fallback-to-dumb-term.patch...
Applied patch gnu/packages/patches/nvi-fallback-to-dumb-term.patch cleanly.
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.

index at:
100644 08dfbbed84af36b0bc3f89ce85f798995bdeadfc	gnu/packages/patches/nvi-fallback-to-dumb-term.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).