-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pullup ticket #5238 - requested by sevan
editors/nvi: bugfix Revisions pulled up: - editors/nvi/Makefile 1.50 - editors/nvi/distinfo 1.23 - editors/nvi/patches/patch-cl_funcs__termh.c 1.1 - editors/nvi/patches/patch-cl_screen__termh.c 1.1 - editors/nvi/patches/patch-common_msg.c 1.2 --- Module Name: pkgsrc Committed By: fhajny Date: Tue Apr 4 07:53:23 UTC 2017 Modified Files: pkgsrc/editors/nvi: Makefile distinfo pkgsrc/editors/nvi/patches: patch-common_msg.c Added Files: pkgsrc/editors/nvi/patches: patch-cl_funcs__termh.c patch-cl_screen__termh.c Log Message: Fix an issue with editor segfaulting in ex mode on Darwin and suppress benign stderr output regarding locale. Reported in joyent/pkgsrc/issues/402, patch provided by @bjcooke in joyent/pkgsrc/pull/463. Bump PKGREVISION.
- Loading branch information
Showing
5 changed files
with
114 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$NetBSD: patch-cl_funcs__termh.c,v 1.1.2.2 2017/04/04 17:32:01 bsiegert Exp $ | ||
|
||
- Suppress compile time warning on Linux and prevent segfault on Darwin when | ||
run as nex. | ||
- Original patch was found in release 13 of nvi 1.81.6 for debian under the | ||
name 19include_term_h.patch. | ||
|
||
##From: <hesso@pool.math.tu-berlin.de> | ||
##Subject: Add <term.h> to the include list to suppress a few warnings. | ||
|
||
--- cl/cl_funcs.c.orig 2007-11-18 17:41:42.000000000 +0100 | ||
+++ cl/cl_funcs.c 2008-05-01 18:23:08.000000000 +0200 | ||
@@ -18,6 +18,7 @@ | ||
#include <sys/time.h> | ||
|
||
#include <bitstring.h> | ||
+#include <term.h> | ||
#include <ctype.h> | ||
#include <signal.h> | ||
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$NetBSD: patch-cl_screen__termh.c,v 1.1.2.2 2017/04/04 17:32:01 bsiegert Exp $ | ||
|
||
- Suppress compile time warning on Linux and prevent segfault on Darwin when | ||
run as nex. | ||
- Original patch was found in release 13 of nvi 1.81.6 for debian under the | ||
name 19include_term_h.patch. | ||
|
||
##From: <hesso@pool.math.tu-berlin.de> | ||
##Subject: Add <term.h> to the include list to suppress a few warnings. | ||
|
||
--- cl/cl_screen.c.orig 2007-11-18 17:41:42.000000000 +0100 | ||
+++ cl/cl_screen.c 2008-05-01 18:23:02.000000000 +0200 | ||
@@ -17,6 +17,7 @@ | ||
#include <sys/queue.h> | ||
|
||
#include <bitstring.h> | ||
+#include <term.h> | ||
#include <errno.h> | ||
#include <signal.h> | ||
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,70 @@ | ||
$NetBSD: patch-common_msg.c,v 1.1 2015/05/11 08:43:44 enami Exp $ | ||
$NetBSD: patch-common_msg.c,v 1.1.16.1 2017/04/04 17:32:01 bsiegert Exp $ | ||
|
||
--- common/msg.c.orig 2007-11-18 16:41:42.000000000 +0000 | ||
--- common/msg.c.orig 2017-04-03 15:17:07.396452540 +0000 | ||
+++ common/msg.c | ||
@@ -640,7 +640,8 @@ msgq_status(SCR *sp, db_recno_t lno, u_i | ||
p += len; | ||
} else { | ||
t = msg_cat(sp, "027|line %lu of %lu [%ld%%]", &len); | ||
- (void)sprintf(p, t, lno, last, (lno * 100) / last); | ||
+ (void)sprintf(p, t, (u_long)lno, (u_long)last, | ||
+ (long)((lno * 100) / last)); | ||
p += strlen(p); | ||
} | ||
} else { | ||
@@ -716,7 +716,7 @@ msg_open(SCR *sp, char *file) | ||
DB *db; | ||
DBT data, key; | ||
db_recno_t msgno; | ||
- char *p, *t, buf[MAXPATHLEN]; | ||
+ char *p, *p2, *t, buf[MAXPATHLEN]; | ||
|
||
if ((p = strrchr(file, '/')) != NULL && p[1] == '\0' && | ||
(((t = getenv("LC_MESSAGES")) != NULL && t[0] != '\0') || | ||
@@ -725,16 +725,15 @@ msg_open(SCR *sp, char *file) | ||
p = buf; | ||
} else | ||
p = file; | ||
- if ((sp->db_error = db_create(&db, 0, 0)) != 0 || | ||
- (sp->db_error = db->set_re_source(db, p)) != 0 || | ||
- (sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) { | ||
- if (first) { | ||
- first = 0; | ||
- return (1); | ||
- } | ||
- msgq_str(sp, M_DBERR, p, "%s"); | ||
- return (1); | ||
- } | ||
+ | ||
+ p2 = "%s"; | ||
+ if ((sp->db_error = db_create(&db, 0, 0)) == 0 && | ||
+ (sp->db_error = db->set_re_source(db, p)) == 0) { | ||
+ db->set_errcall(db, 0); | ||
+ if ((sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) | ||
+ goto err; | ||
+ } else | ||
+ goto err; | ||
|
||
/* | ||
* Test record 1 for the magic string. The msgq call is here so | ||
@@ -750,13 +749,8 @@ msg_open(SCR *sp, char *file) | ||
data.size != sizeof(VMC) - 1 || | ||
memcmp(data.data, VMC, sizeof(VMC) - 1)) { | ||
(void)db->close(db, DB_NOSYNC); | ||
- if (first) { | ||
- first = 0; | ||
- return (1); | ||
- } | ||
- msgq_str(sp, M_DBERR, p, | ||
- "030|The file %s is not a message catalog"); | ||
- return (1); | ||
+ p2 = "030|The file %s is not a message catalog"; | ||
+ goto err; | ||
} | ||
first = 0; | ||
|
||
@@ -764,6 +758,14 @@ msg_open(SCR *sp, char *file) | ||
(void)sp->gp->msg->close(sp->gp->msg, DB_NOSYNC); | ||
sp->gp->msg = db; | ||
return (0); | ||
+ | ||
+err: | ||
+ if (first) { | ||
+ first = 0; | ||
+ return (1); | ||
+ } | ||
+ msgq_str(sp, M_DBERR, p, p2); | ||
+ return (1); | ||
} | ||
|
||
/* |