summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2001-05-29 08:16:05 +0000
committeragc <agc@pkgsrc.org>2001-05-29 08:16:05 +0000
commit00a1b3c8d51a3bd2123f40e038fec5d8e8c5c6fe (patch)
tree4d846ca059c3d32154d85253a19309bdfc25ec57
parent069ec3886307b90e307b0e5fbf79cebe03f4807c (diff)
downloadpkgsrc-00a1b3c8d51a3bd2123f40e038fec5d8e8c5c6fe.tar.gz
Honour the VISUAL and EDITOR settings in the environment before
using ed(1)
-rw-r--r--devel/idiff/distinfo4
-rw-r--r--devel/idiff/patches/patch-aa25
2 files changed, 23 insertions, 6 deletions
diff --git a/devel/idiff/distinfo b/devel/idiff/distinfo
index 00d10f55c48..0fd247ac32e 100644
--- a/devel/idiff/distinfo
+++ b/devel/idiff/distinfo
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.3 2001/04/21 00:44:24 wiz Exp $
+$NetBSD: distinfo,v 1.4 2001/05/29 08:16:05 agc Exp $
SHA1 (idiff-1.0.tar.gz) = 4d3f339184745a45747385bca6f559665c6136f8
Size (idiff-1.0.tar.gz) = 2307 bytes
-SHA1 (patch-aa) = 40b277adc2d1ee493669b2f9716e11a699de76f4
+SHA1 (patch-aa) = c4ca9269a3a3d1432a33c6171af3c88cf541cf70
SHA1 (patch-ab) = 88d480c86527766cb602a57e9d1528da73675dbd
diff --git a/devel/idiff/patches/patch-aa b/devel/idiff/patches/patch-aa
index 53406dfaa98..6286bf23b1e 100644
--- a/devel/idiff/patches/patch-aa
+++ b/devel/idiff/patches/patch-aa
@@ -1,10 +1,13 @@
-$NetBSD: patch-aa,v 1.1.1.1 2001/03/22 10:04:36 agc Exp $
+$NetBSD: patch-aa,v 1.2 2001/05/29 08:16:05 agc Exp $
Don't overwrite read-only strings, so they can be placed in the text
segment by a decent optimising compiler.
---- idiff.c 2001/03/19 13:19:52 1.1
-+++ idiff.c 2001/03/19 13:27:03
+Honour the VISUAL and EDITOR settings in the environment before
+using ed(1)
+
+--- idiff.c.orig Wed Sep 16 20:58:16 1998
++++ idiff.c Tue May 29 09:11:44 2001
@@ -1,5 +1,7 @@
/* idiff: interactive diff */
@@ -30,7 +33,7 @@ segment by a decent optimising compiler.
mktemp(diffout);
sprintf(buf,"diff %s %s >%s",argv[1],argv[2],diffout);
system(buf);
-@@ -34,11 +39,14 @@
+@@ -34,11 +39,15 @@
idiff(f1, f2, fin, fout) /* process diffs */
FILE *f1, *f2, *fin, *fout;
{
@@ -39,9 +42,23 @@ segment by a decent optimising compiler.
char buf[BUFSIZ], buf2[BUFSIZ], *mktemp();
FILE *ft, *efopen();
int cmd, n, from1, to1, from2, to2, nf1, nf2;
++ char *ed;
+ (void) strcpy(realtempfile, tempfile);
+ tempfile = realtempfile;
mktemp(tempfile);
nf1 = nf2 = 0;
while (fgets(buf, sizeof buf, fin) != NULL) {
+@@ -76,7 +85,11 @@
+ fprintf(ft, "---\n");
+ ncopy(f2, to2+1-from2, ft);
+ fclose(ft);
+- sprintf(buf2, "ed %s", tempfile);
++ if ((ed = getenv("VISUAL")) == NULL &&
++ (ed = getenv("EDITOR")) == NULL) {
++ ed = "/bin/ed";
++ }
++ snprintf(buf2, sizeof(buf2), "%s %s", ed, tempfile);
+ system(buf2);
+ ft = efopen(tempfile, "r");
+ ncopy(ft, HUGE, fout);