nvi-23-debian_alternatives.patch (1179B)
1 #! /bin/sh /usr/share/dpatch/dpatch-run 2 ## 23debian_alternatives.dpatch by <hesso@pool.math.tu-berlin.de> 3 ## 4 ## DP: Adapt the internal program name if nvi was called via one of 5 ## DP: the Debian alternative symlinks. 6 7 @DPATCH@ 8 diff -Naur nvi-1.81.6.orig/common/gs.c nvi-1.81.6/common/gs.c 9 --- nvi-1.81.6.orig/common/gs.c 2007-11-18 17:41:42.000000000 +0100 10 +++ nvi-1.81.6/common/gs.c 2008-05-01 18:28:44.000000000 +0200 11 @@ -45,6 +45,24 @@ 12 13 gp->progname = name; 14 15 +#ifdef DEBIAN 16 + /* This is because of the Debian alternatives system. The 17 + definitions of editor, vi, view, and ex are transient. This 18 + would be ok, except that the recovery file hardcodes the 19 + name. The downside of this is that the error messages may 20 + not quite match what the user expects */ 21 + 22 + if (!strcmp(name, "editor")) { 23 + gp->progname = "nvi"; 24 + } else if (!strcmp(name, "vi")){ 25 + gp->progname = "nvi"; 26 + } else if (!strcmp(name, "view")){ 27 + gp->progname = "nview"; 28 + } else if (!strcmp(name, "ex")){ 29 + gp->progname = "nex"; 30 + } 31 +#endif /* DEBIAN */ 32 + 33 /* Common global structure initialization. */ 34 /* others will need to be copied from main.c */ 35 CIRCLEQ_INIT(&gp->dq);