Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/sc/, app-office/sc/files/
Date: Sat, 04 Jun 2016 12:07:10
Message-Id: 1465042022.bf56b8c150845b9424c130ff2f128d07514d2337.jer@gentoo
1 commit: bf56b8c150845b9424c130ff2f128d07514d2337
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 4 12:06:47 2016 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 4 12:07:02 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf56b8c1
7
8 app-office/sc: Replace static char with macro (bug #521118).
9
10 Package-Manager: portage-2.3.0_rc1
11
12 app-office/sc/files/sc-7.16-printf.patch | 102 +++++++++++++++++++++++++++++++
13 app-office/sc/sc-7.16-r2.ebuild | 1 +
14 2 files changed, 103 insertions(+)
15
16 diff --git a/app-office/sc/files/sc-7.16-printf.patch b/app-office/sc/files/sc-7.16-printf.patch
17 new file mode 100644
18 index 0000000..9425105
19 --- /dev/null
20 +++ b/app-office/sc/files/sc-7.16-printf.patch
21 @@ -0,0 +1,102 @@
22 +--- a/sc.c
23 ++++ b/sc.c
24 +@@ -520,7 +520,7 @@
25 + break;
26 + }
27 + }
28 +- if (redraw) printf(redraw);
29 ++ if (redraw) printf("%s", redraw);
30 + exit (0);
31 + }
32 +
33 +--- a/gram.y
34 ++++ b/gram.y
35 +@@ -1010,7 +1010,7 @@
36 + | S_PLUGOUT STRING '=' STRING
37 + { addplugin($2, $4, 'w'); }
38 + | PLUGIN { *line = '|';
39 +- sprintf(line + 1, $1);
40 ++ sprintf(line + 1, "%s", $1);
41 + readfile(line, 0);
42 + scxfree($1); }
43 + | /* nothing */
44 +--- a/vmtbl.c
45 ++++ b/vmtbl.c
46 +@@ -61,10 +61,10 @@
47 + oldptr = newptr /* wait incase we can't alloc */
48 +
49 + #ifndef PSC
50 +-static char nolonger[] = "The table can't be any longer";
51 ++#define NOLONGER "The table can't be any longer"
52 + #endif /* !PSC */
53 +
54 +-static char nowider[] = "The table can't be any wider";
55 ++#define NOWIDER "The table can't be any wider"
56 +
57 + /*
58 + * grow the main && auxiliary tables (reset maxrows/maxcols as needed)
59 +@@ -117,7 +117,7 @@
60 + if ((rowcol == GROWCOL) || (rowcol == GROWBOTH)) {
61 + if ((rowcol == GROWCOL) && ((maxcols == ABSMAXCOLS) ||
62 + (topcol >= ABSMAXCOLS))) {
63 +- error(nowider);
64 ++ error(NOWIDER);
65 + return (FALSE);
66 + }
67 +
68 +@@ -135,14 +135,14 @@
69 + struct ent *** lnullit;
70 + int lcnt;
71 +
72 +- GROWALLOC(row_hidden2, row_hidden, newrows, char, nolonger);
73 ++ GROWALLOC(row_hidden2, row_hidden, newrows, char, NOLONGER);
74 + memset(row_hidden+maxrows, 0, (newrows-maxrows)*sizeof(char));
75 +
76 + /*
77 + * alloc tbl row pointers, per net.lang.c, calloc does not
78 + * necessarily fill in NULL pointers
79 + */
80 +- GROWALLOC(tbl2, tbl, newrows, struct ent **, nolonger);
81 ++ GROWALLOC(tbl2, tbl, newrows, struct ent **, NOLONGER);
82 + for (lnullit = tbl+maxrows, lcnt = 0; lcnt < newrows-maxrows;
83 + lcnt++, lnullit++)
84 + *lnullit = (struct ent **)NULL;
85 +@@ -151,16 +151,16 @@
86 + #endif /* !PSC */
87 +
88 + if ((rowcol == GROWCOL) || (rowcol == GROWBOTH) || (rowcol == GROWNEW)) {
89 +- GROWALLOC(fwidth2, fwidth, newcols, int, nowider);
90 +- GROWALLOC(precision2, precision, newcols, int, nowider);
91 +- GROWALLOC(realfmt2, realfmt, newcols, int, nowider);
92 ++ GROWALLOC(fwidth2, fwidth, newcols, int, NOWIDER);
93 ++ GROWALLOC(precision2, precision, newcols, int, NOWIDER);
94 ++ GROWALLOC(realfmt2, realfmt, newcols, int, NOWIDER);
95 + #ifdef PSC
96 + memset(fwidth+maxcols, 0, (newcols-maxcols)*sizeof(int));
97 + memset(precision+maxcols, 0, (newcols-maxcols)*sizeof(int));
98 + memset(realfmt+maxcols, 0, (newcols-maxcols)*sizeof(int));
99 + }
100 + #else
101 +- GROWALLOC(col_hidden2, col_hidden, newcols, char, nowider);
102 ++ GROWALLOC(col_hidden2, col_hidden, newcols, char, NOWIDER);
103 + memset(col_hidden+maxcols, 0, (newcols-maxcols)*sizeof(char));
104 + for (i = maxcols; i < newcols; i++) {
105 + fwidth[i] = DEFWIDTH;
106 +@@ -172,7 +172,7 @@
107 + for (i = 0; i < maxrows; i++) {
108 + if ((tbl[i] = (struct ent **)scxrealloc((char *)tbl[i],
109 + (unsigned)(newcols * sizeof(struct ent **)))) == (struct ent **)0) {
110 +- error(nowider);
111 ++ error(NOWIDER);
112 + return(FALSE);
113 + }
114 + for (nullit = ATBL(tbl, i, maxcols), cnt = 0;
115 +@@ -190,7 +190,7 @@
116 + for (; i < newrows; i++) {
117 + if ((tbl[i] = (struct ent **)scxmalloc((unsigned)(newcols *
118 + sizeof(struct ent **)))) == (struct ent **)0) {
119 +- error(nowider);
120 ++ error(NOWIDER);
121 + return(FALSE);
122 + }
123 + for (nullit = tbl[i], cnt = 0; cnt < newcols; cnt++, nullit++)
124
125 diff --git a/app-office/sc/sc-7.16-r2.ebuild b/app-office/sc/sc-7.16-r2.ebuild
126 index ae2776c..4656730 100644
127 --- a/app-office/sc/sc-7.16-r2.ebuild
128 +++ b/app-office/sc/sc-7.16-r2.ebuild
129 @@ -27,6 +27,7 @@ PATCHES=(
130 "${FILESDIR}"/${P}-amd64.patch
131 "${FILESDIR}"/${P}-lex-syntax.patch
132 "${FILESDIR}"/${P}-c.patch
133 + "${FILESDIR}"/${P}-printf.patch
134 )
135
136 src_prepare() {