news/nn: fix build with -fno-common

Placement of the shared variables is somewhat haphazard.
This commit is contained in:
naddy 2021-02-06 17:27:38 +00:00
parent a7e057a338
commit 6e00550297
9 changed files with 126 additions and 9 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.20 2020/01/26 11:14:33 jasper Exp $
# $OpenBSD: Makefile,v 1.21 2021/02/06 17:27:38 naddy Exp $
COMMENT = menu-based Usenet newsreader
DISTNAME = nn-6.7.3
REVISION = 5
REVISION = 6
CATEGORIES = news
HOMEPAGE = http://www.nndev.org

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-articles_c,v 1.1 2021/02/06 17:27:38 naddy Exp $
Index: articles.c
--- articles.c.orig
+++ articles.c
@@ -23,6 +23,9 @@
static void new_thunk(thunk * t, char *ptr, long size);
+article_number n_articles;
+article_header **articles;
+
#ifdef ART_GREP
static int grep_article(group_header * gh, article_header * ah, char *pattern, int (*fcn) ());
#endif /* ART_GREP */

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-articles_h,v 1.1 2021/02/06 17:27:38 naddy Exp $
Index: articles.h
--- articles.h.orig
+++ articles.h
@@ -10,8 +10,8 @@
/* article headers */
-article_number n_articles;
-article_header **articles;
+extern article_number n_articles;
+extern article_header **articles;
typedef struct thunk {

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-db_c,v 1.1 2021/02/06 17:27:38 naddy Exp $
Index: db.c
--- db.c.orig
+++ db.c
@@ -127,6 +127,8 @@ group_header *current_group = NULL;
char group_path_name[FILENAME];
char *group_file_name = NULL;
+int l_g_index, s_g_first;
+
static char *group_position = NULL;
static article_number current_digest_article = 0;

View File

@ -1,6 +1,16 @@
$OpenBSD: patch-global_h,v 1.1 2012/03/17 22:36:26 naddy Exp $
--- global.h.orig Sat Mar 17 16:29:59 2012
+++ global.h Sat Mar 17 16:30:22 2012
$OpenBSD: patch-global_h,v 1.2 2021/02/06 17:27:38 naddy Exp $
Index: global.h
--- global.h.orig
+++ global.h
@@ -160,7 +160,7 @@ extern char *group_file_name;
extern group_header *current_group, *group_sequence, *rc_sequence;
-int l_g_index, s_g_first;
+extern int l_g_index, s_g_first;
#define Loop_Groups_Number(num) \
for (num = 0; num < master.number_of_groups; num++)
@@ -258,7 +258,7 @@ int nn_truncate(char *, off_t);
char *strsave(char *);
char *str3save(char *, char *, char *);

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-news_c,v 1.1 2021/02/06 17:27:38 naddy Exp $
Index: news.c
--- news.c.orig
+++ news.c
@@ -24,6 +24,8 @@
static char **art_hdr_field(register char *lp, int all);
+struct news_header news;
+struct digest_header digest;
int retry_on_error = 0;

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-news_h,v 1.1 2021/02/06 17:27:38 naddy Exp $
Index: news.h
--- news.h.orig
+++ news.h
@@ -44,7 +44,8 @@ struct news_header {
char *ng_xlines; /* lines (from header) */
int ng_lines; /* lines (decoded) */
char *ng_comment; /* comment-to (rfmail) */
-} news;
+};
+extern struct news_header news;
/*
@@ -62,7 +63,8 @@ struct digest_header {
char *dg_to; /* to */
int dg_lines; /* lines (pseudo field) */
-} digest;
+};
+extern struct digest_header digest;
#define NEWS_HEADER_BUFFER 4096

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-nn_term_h,v 1.1 2021/02/06 17:27:38 naddy Exp $
Index: nn_term.h
--- nn_term.h.orig
+++ nn_term.h
@@ -48,7 +48,7 @@ extern int STANDOUT;
*/
-int prompt_line; /* prompt line */
+extern int prompt_line; /* prompt line */
#define P_MOVE (char *)1
#define P_REDRAW (char *)5

View File

@ -1,6 +1,7 @@
$OpenBSD: patch-term_c,v 1.3 2017/04/15 14:11:36 naddy Exp $
--- term.c.orig Wed Jun 29 23:40:27 2005
+++ term.c Fri Apr 14 23:16:01 2017
$OpenBSD: patch-term_c,v 1.4 2021/02/06 17:27:38 naddy Exp $
Index: term.c
--- term.c.orig
+++ term.c
@@ -25,7 +25,7 @@
#include "regexp.h"
#include "nn_term.h"
@ -22,7 +23,15 @@ $OpenBSD: patch-term_c,v 1.3 2017/04/15 14:11:36 naddy Exp $
#endif
@@ -171,8 +171,8 @@ extern char *tgoto(); /* some systems don't have th
@@ -139,6 +139,7 @@ int message_history = 15;
char *term_name = NULL;
int show_current_time = 1;
int conf_dont_sleep = 0;
+int prompt_line;
int prompt_length;
int terminal_speed = 0;
int slow_speed = 1200;
@@ -171,8 +172,8 @@ extern char *tgoto(); /* some systems don't have th
#else
char *tgoto();