summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2016-06-04 14:06:47 +0200
committerJeroen Roovers <jer@gentoo.org>2016-06-04 14:07:02 +0200
commitbf56b8c150845b9424c130ff2f128d07514d2337 (patch)
treecde7e6f725d909864e32bd5ccd5826733e2ce6db /app-office/sc
parentdev-libs/capstone: use upstream build system (diff)
downloadgentoo-bf56b8c150845b9424c130ff2f128d07514d2337.tar.gz
gentoo-bf56b8c150845b9424c130ff2f128d07514d2337.tar.bz2
gentoo-bf56b8c150845b9424c130ff2f128d07514d2337.zip
app-office/sc: Replace static char with macro (bug #521118).
Package-Manager: portage-2.3.0_rc1
Diffstat (limited to 'app-office/sc')
-rw-r--r--app-office/sc/files/sc-7.16-printf.patch102
-rw-r--r--app-office/sc/sc-7.16-r2.ebuild1
2 files changed, 103 insertions, 0 deletions
diff --git a/app-office/sc/files/sc-7.16-printf.patch b/app-office/sc/files/sc-7.16-printf.patch
new file mode 100644
index 000000000000..9425105262b0
--- /dev/null
+++ b/app-office/sc/files/sc-7.16-printf.patch
@@ -0,0 +1,102 @@
+--- a/sc.c
++++ b/sc.c
+@@ -520,7 +520,7 @@
+ break;
+ }
+ }
+- if (redraw) printf(redraw);
++ if (redraw) printf("%s", redraw);
+ exit (0);
+ }
+
+--- a/gram.y
++++ b/gram.y
+@@ -1010,7 +1010,7 @@
+ | S_PLUGOUT STRING '=' STRING
+ { addplugin($2, $4, 'w'); }
+ | PLUGIN { *line = '|';
+- sprintf(line + 1, $1);
++ sprintf(line + 1, "%s", $1);
+ readfile(line, 0);
+ scxfree($1); }
+ | /* nothing */
+--- a/vmtbl.c
++++ b/vmtbl.c
+@@ -61,10 +61,10 @@
+ oldptr = newptr /* wait incase we can't alloc */
+
+ #ifndef PSC
+-static char nolonger[] = "The table can't be any longer";
++#define NOLONGER "The table can't be any longer"
+ #endif /* !PSC */
+
+-static char nowider[] = "The table can't be any wider";
++#define NOWIDER "The table can't be any wider"
+
+ /*
+ * grow the main && auxiliary tables (reset maxrows/maxcols as needed)
+@@ -117,7 +117,7 @@
+ if ((rowcol == GROWCOL) || (rowcol == GROWBOTH)) {
+ if ((rowcol == GROWCOL) && ((maxcols == ABSMAXCOLS) ||
+ (topcol >= ABSMAXCOLS))) {
+- error(nowider);
++ error(NOWIDER);
+ return (FALSE);
+ }
+
+@@ -135,14 +135,14 @@
+ struct ent *** lnullit;
+ int lcnt;
+
+- GROWALLOC(row_hidden2, row_hidden, newrows, char, nolonger);
++ GROWALLOC(row_hidden2, row_hidden, newrows, char, NOLONGER);
+ memset(row_hidden+maxrows, 0, (newrows-maxrows)*sizeof(char));
+
+ /*
+ * alloc tbl row pointers, per net.lang.c, calloc does not
+ * necessarily fill in NULL pointers
+ */
+- GROWALLOC(tbl2, tbl, newrows, struct ent **, nolonger);
++ GROWALLOC(tbl2, tbl, newrows, struct ent **, NOLONGER);
+ for (lnullit = tbl+maxrows, lcnt = 0; lcnt < newrows-maxrows;
+ lcnt++, lnullit++)
+ *lnullit = (struct ent **)NULL;
+@@ -151,16 +151,16 @@
+ #endif /* !PSC */
+
+ if ((rowcol == GROWCOL) || (rowcol == GROWBOTH) || (rowcol == GROWNEW)) {
+- GROWALLOC(fwidth2, fwidth, newcols, int, nowider);
+- GROWALLOC(precision2, precision, newcols, int, nowider);
+- GROWALLOC(realfmt2, realfmt, newcols, int, nowider);
++ GROWALLOC(fwidth2, fwidth, newcols, int, NOWIDER);
++ GROWALLOC(precision2, precision, newcols, int, NOWIDER);
++ GROWALLOC(realfmt2, realfmt, newcols, int, NOWIDER);
+ #ifdef PSC
+ memset(fwidth+maxcols, 0, (newcols-maxcols)*sizeof(int));
+ memset(precision+maxcols, 0, (newcols-maxcols)*sizeof(int));
+ memset(realfmt+maxcols, 0, (newcols-maxcols)*sizeof(int));
+ }
+ #else
+- GROWALLOC(col_hidden2, col_hidden, newcols, char, nowider);
++ GROWALLOC(col_hidden2, col_hidden, newcols, char, NOWIDER);
+ memset(col_hidden+maxcols, 0, (newcols-maxcols)*sizeof(char));
+ for (i = maxcols; i < newcols; i++) {
+ fwidth[i] = DEFWIDTH;
+@@ -172,7 +172,7 @@
+ for (i = 0; i < maxrows; i++) {
+ if ((tbl[i] = (struct ent **)scxrealloc((char *)tbl[i],
+ (unsigned)(newcols * sizeof(struct ent **)))) == (struct ent **)0) {
+- error(nowider);
++ error(NOWIDER);
+ return(FALSE);
+ }
+ for (nullit = ATBL(tbl, i, maxcols), cnt = 0;
+@@ -190,7 +190,7 @@
+ for (; i < newrows; i++) {
+ if ((tbl[i] = (struct ent **)scxmalloc((unsigned)(newcols *
+ sizeof(struct ent **)))) == (struct ent **)0) {
+- error(nowider);
++ error(NOWIDER);
+ return(FALSE);
+ }
+ for (nullit = tbl[i], cnt = 0; cnt < newcols; cnt++, nullit++)
diff --git a/app-office/sc/sc-7.16-r2.ebuild b/app-office/sc/sc-7.16-r2.ebuild
index ae2776cee0db..4656730833cf 100644
--- a/app-office/sc/sc-7.16-r2.ebuild
+++ b/app-office/sc/sc-7.16-r2.ebuild
@@ -27,6 +27,7 @@ PATCHES=(
"${FILESDIR}"/${P}-amd64.patch
"${FILESDIR}"/${P}-lex-syntax.patch
"${FILESDIR}"/${P}-c.patch
+ "${FILESDIR}"/${P}-printf.patch
)
src_prepare() {