Subject: [alpine-aports] [PATCH] testing/sc added debian patch

From: ScrumpyJack <[email-masked]>
Date: Tue, 18 Aug 2015 11:43:24 +0000 (UTC)

Speadsheet Calculator
https://github.com/dkastner/sc
---
 testing/sc/APKBUILD        |  23 +-
 testing/sc/sc_7.16-2.patch | 782 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 795 insertions(+), 10 deletions(-)
 create mode 100644 testing/sc/sc_7.16-2.patch

diff --git a/testing/sc/APKBUILD b/testing/sc/APKBUILD
index a19c019..1a0b93c 100644
--- a/testing/sc/APKBUILD
+++ b/testing/sc/APKBUILD
@@ -2,17 +2,18 @@
 # Maintainer:
 pkgname=sc
 pkgver=7.16
-pkgrel=0
+pkgrel=1
 pkgdesc="Speadsheet Calculator"
 url="https://github.com/dkastner/sc"
 arch="all"
 license="Public Domain"
 depends="ncurses"
-depends_dev="ncurses-dev bison"
-makedepends="$depends_dev"
+depends_dev=""
+makedepends="ncurses-dev bison"
 install=""
 subpackages="$pkgname-doc"
-source="http://ibiblio.org/pub/linux/apps/financial/spreadsheet/$pkgname-$pkgver.tar.gz https://launchpadlibrarian.net/1281150/${pkgname}_${pkgver}-2.diff.gz"
+source="http://ibiblio.org/pub/linux/apps/financial/spreadsheet/$pkgname-$pkgver.tar.gz
+       sc_7.16-2.patch"
 
 _builddir="$srcdir/$pkgname-$pkgver"
 prepare() {
@@ -20,7 +21,7 @@ prepare() {
 	cd "$_builddir"
 	for i in $source; do
 		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/${pkgname}_${pkgver}-2.diff || return 1;;
+                *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
 		esac
 	done
 }
@@ -32,12 +33,14 @@ build() {
 
 package() {
 	cd "$_builddir"
-	mkdir -p "$pkgdir/usr/bin" "$pkgdir/usr/lib" "$pkgdir/usr/share/man/man1"
-	make prefix="$pkgdir"/usr MANDIR="$pkgdir"/usr/share/man/man1 install || return 1
+	mkdir -p "$pkgdir/usr/bin" "$pkgdir/usr/lib" "$pkgdir/usr/share/doc" \
+           "$pkgdir/usr/share/man"
+	make prefix="$pkgdir"/usr MANDIR="$pkgdir/usr/share/man" install \
+        || return 1
 }
 md5sums="1db636e9b2dc7cd73c40aeece6852d47  sc-7.16.tar.gz
-83d5d8a4b5ffb4e85da887b63c49f2ff  sc_7.16-2.diff.gz"
+58c3c966ab818ddee9726880ea7e6e44  sc_7.16-2.patch"
 sha256sums="1997a00b6d82d189b65f6fd2a856a34992abc99e50d9ec463bbf1afb750d1765  sc-7.16.tar.gz
-37116b9619790564650c4090b4a6264c08aa59fa1e24c63ca073011cd70507cb  sc_7.16-2.diff.gz"
+8146623fb7369d4cc10a91032a646519077314a04632d1c40d5b97d0967a70d0  sc_7.16-2.patch"
 sha512sums="efa495ba21d01b578a53f09101ccc28b564437317e0860904ad59136a24df9619dfc8715339296ae1567eaa8d620cdabc9bc2784962bc1c93e3bbd086856407b  sc-7.16.tar.gz
-3dd916b2aee6e8ececed69c813dfffedd77054092fa38db7604a10d252a6cacb20ddfe9f270d31d4145f88b0d48040e3b0db6a698b21358ba57d8e9db2b5cbad  sc_7.16-2.diff.gz"
+cb025e84148085e37bfb0ee02bdda60e5ab146ded14f5f0da2f17b3dbf0ba330eef87e534f8a0085265e53295591de222350eb918bb0d1d2994894ce19b16862  sc_7.16-2.patch"
diff --git a/testing/sc/sc_7.16-2.patch b/testing/sc/sc_7.16-2.patch
new file mode 100644
index 0000000..5028224
--- /dev/null
+++ b/testing/sc/sc_7.16-2.patch
@@ -0,0 +1,782 @@
+--- sc-7.16.orig/sc.h
++++ sc-7.16/sc.h
+@@ -612,6 +612,9 @@
+ extern	int rowlimit;
+ extern	int collimit;
+ 
++void yankr(struct ent *v1, struct ent *v2);
++
++
+ #if BSD42 || SYSIII
+ 
+ #ifndef cbreak
+--- sc-7.16.orig/cmds.c
++++ sc-7.16/cmds.c
+@@ -478,7 +478,7 @@
+     int i, qtmp;
+     char buf[50];
+     struct frange *fr;
+-    struct ent *obuf;
++    struct ent *obuf=0;
+ 
+     if ((fr = find_frange(currow, curcol)))
+ 	rs = fr->or_right->row - currow + 1;
+@@ -535,7 +535,7 @@
+     int cs = maxcol - curcol + 1;
+     int i, qtmp;
+     char buf[50];
+-    struct ent *obuf;
++    struct ent *obuf=0;
+ 
+     if (cs - arg < 0) {
+     	cs = cs > 0 ? cs : 0;
+@@ -810,7 +810,7 @@
+ 
+     if (to_insert == 'r') {
+ 	insertrow(numrows, 0);
+-	if (fr = find_frange(currow, curcol))
++	if ((fr = find_frange(currow, curcol)))
+ 	    deltac = fr->or_left->col - mincol;
+ 	else {
+ 	    for (i = 0; i < numrows; i++)
+@@ -2279,7 +2279,7 @@
+ 	ret->e.r.right.vp = lookat(newrow, newcol);
+ 	ret->e.r.right.vf = e->e.r.right.vf;
+     } else {
+-	struct enode *temprange;
++	struct enode *temprange=0;
+ 
+ 	if (freeenodes) {
+ 	    ret = freeenodes;
+@@ -2337,8 +2337,7 @@
+ 		break;
+ 	    case 'f':
+ 	    case 'F':
+-		if (range && ret->op == 'F' ||
+-			!range && ret->op == 'f')
++		if ((range && ret->op == 'F') || (!range && ret->op == 'f'))
+ 		    Rdelta = Cdelta = 0;
+ 		ret->e.o.left = copye(e->e.o.left, Rdelta, Cdelta,
+ 			r1, c1, r2, c2, transpose);
+@@ -2798,7 +2797,7 @@
+ write_cells(register FILE *f, int r0, int c0, int rn, int cn, int dr, int dc)
+ {
+     register struct ent **pp;
+-    int r, c, rs, cs, mf;
++    int r, c, rs=0, cs=0, mf;
+     char *dpointptr;
+ 
+     mf = modflg;
+@@ -2861,12 +2860,12 @@
+ 	if ((plugin = findplugin(p+1, 'w')) != NULL) {
+ 	    if (!plugin_exists(plugin, strlen(plugin), save + 1)) {
+ 		error("plugin not found");
+-		return;
++		return -1;
+ 	    }
+ 	    *save = '|';
+ 	    if ((strlen(save) + strlen(fname) + 20) > PATHLEN) {
+ 		error("Path too long");
+-		return;
++		return -1;
+ 	    }
+ 	    sprintf(save + strlen(save), " %s%d:", coltoa(c0), r0);
+ 	    sprintf(save + strlen(save), "%s%d \"%s\"", coltoa(cn), rn, fname);
+@@ -2883,13 +2882,14 @@
+     }
+ #endif /* VMS */
+ 
+-    if (*fname == '\0')
++    if (*fname == '\0'){
+ 	if (isatty(STDOUT_FILENO) || *curfile != '\0')
+ 	    fname = curfile;
+ 	else {
+ 	    write_fd(stdout, r0, c0, rn, cn);
+ 	    return (0);
+ 	}
++    }
+ 
+ #ifdef MSDOS
+     namelen = 12;
+@@ -2981,12 +2981,12 @@
+ 	if ((plugin = findplugin(p+1, 'r')) != NULL) {
+ 	    if (!(plugin_exists(plugin, strlen(plugin), save + 1))) {
+ 		error("plugin not found");
+-		return;
++		return -1;
+ 	    }
+ 	    *save = '|';
+ 	    if ((strlen(save) + strlen(fname) + 2) > PATHLEN) {
+ 		error("Path too long");
+-		return;
++		return -1;
+ 	    }
+ 	    sprintf(save + strlen(save), " \"%s\"", fname);
+ 	    eraseflg = 0;
+--- sc-7.16.orig/abbrev.c
++++ sc-7.16/abbrev.c
+@@ -19,10 +19,15 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <ctype.h>
++#include <curses.h>
++#include <unistd.h>
+ #include "sc.h"
+ 
+ static	struct abbrev *abbr_base;
+ 
++int are_abbrevs(void);
++
++
+ void
+ add_abbr(char *string)
+ {
+@@ -87,7 +92,7 @@
+ 	    }
+     }
+     
+-    if (expansion == NULL)
++    if (expansion == NULL){
+ 	if ((a = find_abbr(string, strlen(string), &prev))) {
+ 	    error("abbrev \"%s %s\"", a->abbr, a->exp);
+ 	    return;
+@@ -95,6 +100,7 @@
+ 	    error("abreviation \"%s\" doesn't exist", string);
+ 	    return;
+ 	}
++    }
+  
+     if (find_abbr(string, strlen(string), &prev))
+ 	del_abbr(string);
+@@ -122,7 +128,7 @@
+ del_abbr(char *abbrev)
+ {
+     struct abbrev *a;
+-    struct abbrev **prev;
++    struct abbrev **prev=0;
+ 
+     if (!(a = find_abbr(abbrev, strlen(abbrev), prev))) 
+ 	return;
+--- sc-7.16.orig/range.c
++++ sc-7.16/range.c
+@@ -18,6 +18,8 @@
+ 
+ #include <stdio.h>
+ #include <ctype.h>
++#include <unistd.h>
++#include <curses.h>
+ #include "sc.h"
+ 
+ static	struct range *rng_base;
+--- sc-7.16.orig/vi.c
++++ sc-7.16/vi.c
+@@ -17,6 +17,8 @@
+ #include <curses.h>
+ #include <ctype.h>
+ #include <stdlib.h>
++#include <unistd.h>
++#include <sys/wait.h>
+ #include "sc.h"
+ 
+ #if defined(REGCOMP)
+@@ -40,7 +42,7 @@
+ 
+ #define istext(a) (isalnum(a) || ((a) == '_'))
+ 
+-#define bool	int
++/*#define bool	int*/
+ #define true	1
+ #define false	0
+ 
+@@ -667,8 +669,10 @@
+     static struct range *nextmatch;
+     int len;
+ 
+-    if (linelim > 0 && isalnum(line[linelim-1]) || line[linelim-1] == '_' ||
+-	    (completethis && line[linelim-1] == ' ')) {
++    if ((linelim > 0 && isalnum(line[linelim-1])) || 
++    	line[linelim-1] == '_' ||
++	(completethis && line[linelim-1] == ' ')) {
++
+ 	if (!completethis) {
+ 	    for (completethis = line + linelim - 1; isalnum(*completethis) ||
+ 		    *completethis == '_'; completethis--) /* */;
+@@ -715,7 +719,7 @@
+ showdr()
+ {
+     int			minsr, minsc, maxsr, maxsc;
+-    char		*p;
++    /*char		*p;*/
+     char		r[12];
+     struct frange	*fr = find_frange(currow, curcol);
+ 
+@@ -1566,7 +1570,7 @@
+ search_again(bool reverse)
+ {
+     int prev_match;
+-    int found_it;
++    int found_it=0;
+ #if !defined(REGCOMP) && !defined(RE_COMP) && !defined(REGCMP)
+     char *look_here;
+     int do_next;
+@@ -1777,7 +1781,7 @@
+ static void
+ match_paren()
+ {
+-    register int i;
++    /*register int i;*/
+     int nest = 1;
+     int tmp = linelim;
+ 
+--- sc-7.16.orig/vmtbl.c
++++ sc-7.16/vmtbl.c
+@@ -16,6 +16,7 @@
+ # include <curses.h>
+ #endif /* PSC */
+ 
++#include <unistd.h>
+ #include "sc.h"
+ 
+ /*
+--- sc-7.16.orig/Makefile
++++ sc-7.16/Makefile
+@@ -32,7 +32,7 @@
+ 
+ # This is where the library file (tutorial) goes.
+ #LIBDIR=/usr/local/share/$(name) # reno
+-LIBDIR=${prefix}/lib/$(name)
++LIBDIR=${prefix}/share/doc/$(name)
+ LIBRARY=-DLIBDIR=\"${LIBDIR}\"
+ 
+ # Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up
+--- sc-7.16.orig/color.c
++++ sc-7.16/color.c
+@@ -19,6 +19,7 @@
+ 
+ #include <curses.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include "sc.h"
+ 
+ /* a linked list of free [struct ent]'s, uses .next as the pointer */
+--- sc-7.16.orig/debian/sc.dirs
++++ sc-7.16/debian/sc.dirs
+@@ -0,0 +1,3 @@
++usr/bin
++usr/share/doc/sc
++usr/share/man/man1
+--- sc-7.16.orig/debian/control
++++ sc-7.16/debian/control
+@@ -0,0 +1,20 @@
++Source: sc
++Section: math
++Priority: optional
++Build-Depends: libncurses5-dev, bison, debhelper (>=4)
++Maintainer: Adam Majer <[email-masked]>
++Standards-Version: 3.6.1
++
++Package: sc
++Architecture: any
++Depends: ${shlibs:Depends}
++Description: Text-based spreadsheet with VI-like keybindings
++ "Spreadsheet Calculator" is a much modified version of the public-
++ domain spread sheet sc, which was posted to Usenet several years ago
++ by Mark Weiser as vc, originally by James Gosling. It is based on
++ rectangular table much like a financial spreadsheet.
++ .
++ Its keybindings are familiar to users of 'vi', and it has most
++ features that a pure spreadsheet would, but lacks things like
++ graphing and saving in foreign formats.  It's very stable and quite
++ easy to use once you've put a little effort into learning it.
+--- sc-7.16.orig/debian/compat
++++ sc-7.16/debian/compat
+@@ -0,0 +1 @@
++4
+--- sc-7.16.orig/debian/changelog
++++ sc-7.16/debian/changelog
+@@ -0,0 +1,117 @@
++sc (7.16-2) unstable; urgency=low
++
++  * New maintainer (closes: #260000)
++  * Fixed the code to remove most of the warnings during compile.
++  * No longer tries to "redefine" malloc (closes: #259840)
++  * debian/rules now uses debhelper
++
++ -- Adam Majer <[email-masked]>  Mon, 19 Jul 2004 14:24:48 -0500
++
++sc (7.16-1) unstable; urgency=low
++
++  * New upstream version.  (closes: Bug#131782, Bug#169590)
++  * Doesn't use '#' as backup character.  (closes: Bug#127612)
++  * Help page index fixed.  (closes: Bug#115456)
++  * Tutorial file location corrected in man page.  (closes: Bug#115454)
++
++ -- Chad Miller <[email-masked]>  Tue, 19 Nov 2002 14:11:52 -0500
++
++sc (7.13-2) unstable; urgency=low
++
++  * Fixed spelling error in package description.
++
++ -- Chad Miller <[email-masked]>  Tue, 18 Dec 2001 14:22:47 +0000
++
++sc (7.13-1) unstable; urgency=low
++
++  * New upstream version; many bugfixes.  (closes: Bug#114473)
++
++ -- Chad Miller <[email-masked]>  Thu,  4 Oct 2001 19:54:46 +0000
++
++sc (6.21-12) unstable; urgency=low
++
++  * Installed 'tutorial.sc' in doc directory.  (closes: Bug:85546)
++
++ -- Chad Miller <[email-masked]>  Sat, 17 Mar 2001 15:03:21 -0500
++
++sc (6.21-11) unstable; urgency=low
++
++  * Maintainer change. (closes: Bug#68149)
++  * Put manpages under /usr/share/man, as recent policy says.
++  * Added to CFLAGS, to prevent ``still changing'' bug on some architectures.
++    (closes: Bug#50986)
++
++ -- Chad Miller <[email-masked]>  Mon,  8 Jan 2001 15:20:02 -0500
++
++sc (6.21-10) unstable; urgency=low
++
++  * Added support for cursor keys, thanks to D. J. Raymond
++    <[email-masked]>
++
++ -- Martin Schulze <[email-masked]>  Sun,  2 Jan 2000 17:35:34 +0100
++
++sc (6.21-9) unstable; urgency=low, closes=48133
++
++  * Corrected manpage creation (closes: Bug#48133)
++
++ -- Martin Schulze <[email-masked]>  Fri, 29 Oct 1999 00:32:30 +0200
++
++sc (6.21-8) frozen unstable; urgency=low, closes=29540
++
++  * Removed external declaration for strcpy() and strcat() from format.c
++    and included <string.h> instead. (closes: Bug#29540)
++
++ -- Martin Schulze <[email-masked]>  Tue, 17 Nov 1998 11:19:50 +0100
++
++sc (6.21-7) unstable; urgency=low
++
++  * Re-compiled against ncurses4
++
++ -- Martin Schulze <[email-masked]>  Fri, 30 Oct 1998 11:14:48 +0100
++
++sc (6.21-6) unstable; urgency=low
++
++  * Applied y2k patch from L J Bayuk <[email-masked]>.  Thanks to
++    Ray for forwarding.
++
++ -- Martin Schulze <[email-masked]>  Fri, 23 Oct 1998 19:21:05 +0200
++
++sc (6.21-5) unstable; urgency=low, closes=25513 23241
++
++  * Undebhelpering it
++  * Recompiled against ncurses3.4 to make it work with that lib (closes:
++    Bug#25513, Bug#23241)
++  * This works together with the current ncurses package
++
++ -- Martin Schulze <[email-masked]>  Sun,  6 Sep 1998 22:22:47 +0000
++
++sc (6.21-4) unstable; urgency=high, closes=22616
++
++  * Recompiled against ncurses3.4 to make it work with that lib (closes:
++    Bug#22616)
++  * Added Conflicts: ncurses3.4 (<<1.9.9g-8.2)
++
++ -- Martin Schulze <[email-masked]>  Tue, 19 May 1998 10:30:44 +0200
++
++sc (6.21-3) frozen unstable; urgency=low, closes=20915
++
++  * Corrected sc.1 manpage (closes: Bug#20915)
++  * Removed dh_du
++  * Added scqref.1 undocumented manpage link
++
++ -- Martin Schulze <[email-masked]>  Sat, 11 Apr 1998 04:45:23 +0200
++
++sc (6.21-2) unstable; urgency=low, closes=20079
++
++  * Removed dependency to regex (closes: Bug#20079)
++  * Little code clean ups in pvmtbl.c
++
++ -- Martin Schulze <[email-masked]>  Mon, 23 Mar 1998 01:56:31 +0100
++
++sc (6.21-1) unstable; urgency=low
++
++  * First release
++  * Removed references to initkbd(), resetkbd() and kbd_again()
++  * Changed nmgetch() to getch()
++
++ -- Martin Schulze <[email-masked]>  Thu, 12 Mar 1998 02:58:48 +0100
+--- sc-7.16.orig/debian/copyright
++++ sc-7.16/debian/copyright
+@@ -0,0 +1,15 @@
++This is the Debian GNU/Linux prepackaged version of the public domain
++spread sheet sc, posted several years ago by Mark Weiser as vc,
++originally by James Gosling.
++
++This package was originally put together by 
++Martin Schulze <[email-masked]>, and later adopted by 
++Chad Miller <[email-masked]>.  Source was obtained from:
++  http://ibiblio.org/pub/Linux/apps/financial/spreadsheet/sc-7.13.tar.gz
++
++Sc is not a product of ProsLink, Inc.  It is supplied as is with no
++warranty, express or implied, as a service to Usenet readers.  It is
++not copyrighted, either.  Have at it.
++
++Some of the files were originally written by Robert Bond, James
++Gosling, Bradley Williams or Mark Nagel.
+--- sc-7.16.orig/debian/rules
++++ sc-7.16/debian/rules
+@@ -0,0 +1,95 @@
++#!/usr/bin/make -f
++# -*- makefile -*-
++# Sample debian/rules that uses debhelper.
++# GNU copyright 1997 to 1999 by Joey Hess.
++
++# Uncomment this to turn on verbose mode.
++#export DH_VERBOSE=1
++
++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
++	CFLAGS += -O0
++else
++	CFLAGS += -O2
++endif
++ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
++	INSTALL_PROGRAM += -s
++endif
++
++configure: configure-stamp
++configure-stamp:
++	dh_testdir
++	# Add here commands to configure the package.
++	touch configure-stamp
++
++
++build: build-stamp
++
++build-stamp: configure-stamp 
++	dh_testdir
++
++	# Add here commands to compile the package.
++	$(MAKE) all sc.1 psc.1 CC=gcc CFLAGS="-O2 -Wall -DSYSV3 -ffloat-store"
++	#/usr/bin/docbook-to-man debian/sc.sgml > sc.1
++
++	touch build-stamp
++
++clean:
++	dh_testdir
++	dh_testroot
++	rm -f build-stamp configure-stamp
++
++	# Add here commands to clean up after the build process.
++	-test -f Makefile && $(MAKE) clean
++	rm -f sc psc scqref
++	find . -name '*~' -exec rm {} \;
++	rm -rf stamp-build *~
++
++	dh_clean 
++
++install: build
++	dh_testdir
++	dh_testroot
++	dh_clean -k 
++	dh_installdirs
++
++	# Add here commands to install the package into debian/sc.
++	# $(MAKE) install DESTDIR=$(CURDIR)/debian/sc
++
++
++# Build architecture-independent files here.
++binary-indep: build install
++# We have nothing to do by default.
++
++# Build architecture-dependent files here.
++binary-arch: build install
++	dh_testdir
++	dh_testroot
++	dh_installchangelogs CHANGES
++	dh_installdocs
++#	dh_installexamples
++	dh_install
++#	dh_installmenu
++#	dh_installdebconf	
++#	dh_installlogrotate
++#	dh_installemacsen
++#	dh_installpam
++#	dh_installmime
++#	dh_installinit
++#	dh_installcron
++#	dh_installinfo
++	dh_installman
++#	dh_link
++	dh_strip
++	dh_compress
++	dh_fixperms
++#	dh_perl
++#	dh_python
++#	dh_makeshlibs
++	dh_installdeb
++	dh_shlibdeps
++	dh_gencontrol
++	dh_md5sums
++	dh_builddeb
++
++binary: binary-indep binary-arch
++.PHONY: build clean binary-indep binary-arch binary install configure
+--- sc-7.16.orig/debian/sc.docs
++++ sc-7.16/debian/sc.docs
+@@ -0,0 +1,2 @@
++README
++tutorial.sc
+--- sc-7.16.orig/debian/sc.install
++++ sc-7.16/debian/sc.install
+@@ -0,0 +1,3 @@
++sc	usr/bin
++psc	usr/bin
++scqref	usr/bin
+--- sc-7.16.orig/debian/sc.manpages
++++ sc-7.16/debian/sc.manpages
+@@ -0,0 +1,2 @@
++psc.1
++sc.1
+--- sc-7.16.orig/frame.c
++++ sc-7.16/frame.c
+@@ -18,6 +18,9 @@
+ 
+ #include <stdio.h>
+ #include <ctype.h>
++#include <stdlib.h>
++#include <curses.h>
++#include <unistd.h>
+ #include "sc.h"
+ 
+ static struct frange *frame_base;
+--- sc-7.16.orig/sc.c
++++ sc-7.16/sc.c
+@@ -212,7 +212,7 @@
+ 
+     if (dbidx < 0)
+ 	return;
+-    if (p = delbuf[dbidx]) {
++    if ((p = delbuf[dbidx])) {
+ 	scxfree(delbuffmt[dbidx]);
+ 	delbuffmt[dbidx] = NULL;
+     }
+@@ -845,7 +845,7 @@
+ 			    break;
+ 			case 'C':
+ 			    color = !color;
+-			    if (has_colors())
++			    if (has_colors()){
+ 				if (color) {
+ 				    attron(COLOR_PAIR(1));
+ 				    bkgd(COLOR_PAIR(1) | ' ');
+@@ -853,6 +853,7 @@
+ 				    attron(COLOR_PAIR(0));
+ 				    bkgd(COLOR_PAIR(0) | ' ');
+ 				}
++			    }
+ 			    error("Color %sabled.", color ? "en" : "dis");
+ 			    break;
+ 			case 'N':
+--- sc-7.16.orig/sort.c
++++ sc-7.16/sort.c
+@@ -19,6 +19,8 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <stdlib.h>
++#include <unistd.h>
++#include <curses.h>
+ #include "sc.h"
+ 
+ int compare(const void *row1, const void *row2);
+--- sc-7.16.orig/xmalloc.c
++++ sc-7.16/xmalloc.c
+@@ -4,11 +4,12 @@
+  */
+ 
+ #include <curses.h>
++#include <stdlib.h>
+ #include "sc.h"
+ 
+-extern char	*malloc();
++/* extern char	*malloc();
+ extern char	*realloc();
+-extern void	free();
++extern void	free(); */
+ void		fatal();
+ 
+ #ifdef SYSV3
+--- sc-7.16.orig/screen.c
++++ sc-7.16/screen.c
+@@ -234,11 +234,12 @@
+ 	    i = stcol;
+ 	    lcols = 0;
+ 	    col = rescol + frcols;
+-	    if (fr && stcol >= fr->or_left->col)
++	    if (fr && stcol >= fr->or_left->col){
+ 		if (stcol < fr->ir_left->col)
+ 		    i = fr->or_left->col;
+ 		else
+ 		    col += flcols;
++	    }
+ 	    for (; (col + fwidth[i] < cols-1 || col_hidden[i] || i < curcol) &&
+ 		    i < maxcols; i++) {
+ 		lcols++;
+@@ -328,11 +329,12 @@
+ 	    i = stcol;
+ 	    lcols = 0;
+ 	    col = rescol + frcols;
+-	    if (fr && stcol >= fr->or_left->col)
++	    if (fr && stcol >= fr->or_left->col){
+ 		if (stcol < fr->ir_left->col)
+ 		    i = fr->or_left->col;
+ 		else
+ 		    col += flcols;
++	    }
+ 	    for (; (col + fwidth[i] < cols-1 || col_hidden[i] || i < curcol) &&
+ 		    i < maxcols; i++) {
+ 		lcols++;
+@@ -377,11 +379,12 @@
+ 	    i = strow;
+ 	    rows = 0;
+ 	    row = RESROW + fbrows;
+-	    if (fr && strow >= fr->or_left->row)
++	    if (fr && strow >= fr->or_left->row){
+ 		if (strow < fr->ir_left->row)
+ 		    i = fr->or_left->row;
+ 		else
+ 		    row += ftrows;
++	    }
+ 	    for (; (row < lines || row_hidden[i] || i < currow) && i < maxrows;
+ 		    i++) {
+ 		rows++;
+@@ -460,11 +463,12 @@
+ 	    i = strow;
+ 	    rows = 0;
+ 	    row = RESROW + fbrows;
+-	    if (fr && strow >= fr->or_left->row)
++	    if (fr && strow >= fr->or_left->row){
+ 		if (strow < fr->ir_left->row)
+ 		    i = fr->or_left->row;
+ 		else
+ 		    row += ftrows;
++	    }
+ 	    for (; (row < lines || row_hidden[i] || i < currow) && i < maxrows;
+ 		    i++) {
+ 		rows++;
+--- sc-7.16.orig/lex.c
++++ sc-7.16/lex.c
+@@ -34,6 +34,8 @@
+ #include <signal.h>
+ #include <setjmp.h>
+ #include <ctype.h>
++#include <unistd.h>
++#include <math.h>
+ #include "sc.h"
+ 
+ #ifdef NONOTIMEOUT
+@@ -107,7 +109,7 @@
+ yylex()
+ {
+     char *p = line + linelim;
+-    int ret;
++    int ret=0;
+     static int isfunc = 0;
+     static bool isgoto = 0;
+     static bool colstate = 0;
+@@ -326,7 +328,7 @@
+ 	strcpy((char *)path, HomeDir);
+ 	strcat((char *)path, "/.sc/plugins/");
+ 	strncat((char *)path, name, len);
+-	if (fp = fopen((char *)path, "r")) {
++	if ((fp = fopen((char *)path, "r"))) {
+ 	    fclose(fp);
+ 	    return 1;
+ 	}
+@@ -334,7 +336,7 @@
+     strcpy((char *)path, LIBDIR);
+     strcat((char *)path, "/plugins/");
+     strncat((char *)path, name, len);
+-    if (fp = fopen((char *)path, "r")) {
++    if ((fp = fopen((char *)path, "r"))) {
+ 	fclose(fp);
+ 	return 1;
+     }
+--- sc-7.16.orig/interp.c
++++ sc-7.16/interp.c
+@@ -1572,12 +1572,12 @@
+ copy(struct ent *dv1, struct ent *dv2, struct ent *v1, struct ent *v2)
+ {
+     struct ent *p;
+-    struct ent *n;
++/*    struct ent *n;*/
+     static int minsr = -1, minsc = -1;
+     static int maxsr = -1, maxsc = -1;
+     int mindr, mindc;
+     int maxdr, maxdc;
+-    int vr, vc;
++/*    int vr, vc;*/
+     int r, c;
+     int deltar, deltac;
+ 
+@@ -2066,7 +2066,7 @@
+ 		    *line = '\0';
+ 	    }
+ 	}
+-	if (!col_hidden[c])
++	if (!col_hidden[c]){
+ 	    if (gs.g_type == G_STR) {
+ 		if (p && p->label
+ #if defined(REGCOMP)
+@@ -2099,6 +2099,7 @@
+ #endif
+ #endif
+ 		    break;
++	}
+ 	if (r == endr && c == endc) {
+ 	    error("String not found");
+ #if defined(REGCOMP)
+@@ -2471,13 +2472,11 @@
+ int
+ constant(register struct enode *e)
+ {
+-    return (
+-	 e == NULL
++    return e == NULL
+ 	 || e->op == O_CONST
+ 	 || e->op == O_SCONST
+-	 || e->op == 'm' && constant(e->e.o.left)
+-	 || (
+-	     e->op != O_VAR
++	 || (e->op == 'm' && constant(e->e.o.left))
++	 || (e->op != O_VAR
+ 	     && !(e->op & REDUCE)
+ 	     && constant(e->e.o.left)
+ 	     && constant(e->e.o.right)
+@@ -2491,9 +2490,7 @@
+ 	     && e->op != LASTCOL
+ 	     && e->op != NUMITER
+ 	     && e->op != FILENAME
+-             && optimize
+-	)
+-    );
++             && optimize );
+ }
+ 
+ void
+--- sc-7.16.orig/help.c
++++ sc-7.16/help.c
+@@ -11,6 +11,7 @@
+ char	*revision = "$Revision: 7.16 $";
+ #else
+ #include <curses.h>
++#include <unistd.h>
+ #include "sc.h"
+ #endif /* QREF */
+ 
-- 
2.4.6

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---