From owner-svn-soc-all@FreeBSD.ORG Mon Aug 13 05:13:33 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 1BE5A106564A for ; Mon, 13 Aug 2012 05:13:31 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 13 Aug 2012 05:13:31 +0000 Date: Mon, 13 Aug 2012 05:13:31 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120813051332.1BE5A106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r240318 - soc2012/jhagewood/sdiff X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2012 05:13:33 -0000 Author: jhagewood Date: Mon Aug 13 05:13:31 2012 New Revision: 240318 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240318 Log: Added -lz flags to compile options in sdiff's Makefile. Modified: soc2012/jhagewood/sdiff/Makefile soc2012/jhagewood/sdiff/sdiff.c Modified: soc2012/jhagewood/sdiff/Makefile ============================================================================== --- soc2012/jhagewood/sdiff/Makefile Mon Aug 13 04:35:38 2012 (r240317) +++ soc2012/jhagewood/sdiff/Makefile Mon Aug 13 05:13:31 2012 (r240318) @@ -15,8 +15,8 @@ #.endif PROG= sdiff zsdiff -SRCS= common.c edit.c sdiff.c -COPTS+= -Wall -W +SRCS= common.c edit.c sdiff.c decompress.c +COPTS+= -Wall -W -lz LDADD+= -lutil DPADD+= ${LIBUTIL} Modified: soc2012/jhagewood/sdiff/sdiff.c ============================================================================== --- soc2012/jhagewood/sdiff/sdiff.c Mon Aug 13 04:35:38 2012 (r240317) +++ soc2012/jhagewood/sdiff/sdiff.c Mon Aug 13 05:13:31 2012 (r240318) @@ -89,10 +89,10 @@ int Iflag = 0; /* ignore sets matching regexp */ int lflag; /* print only left column for identical lines */ int sflag; /* skip identical lines */ +int filebehave; /* open file behavior */ FILE *outfp; /* file to save changes to */ const char *tmpdir; /* TMPDIR or /tmp */ -char *pn; /* program name */ -char *filebehave; /* open file behavior */ +const char *pn; /* program name */ enum { HELP_OPT = CHAR_MAX + 1, @@ -470,6 +470,9 @@ warn("Error deleting %s.", tmp2); free(tmp1); free(tmp2); + if (filebehave == FILE_GZIP) { + diffprog = ZDIFF_PATH; + } binexec(diffprog, filename1, filename2); } /* Line numbers start at one. */ @@ -526,16 +529,11 @@ binexec(char *diffprog, char *f1, char *f2) { - char *args[]; - - if (filebehave == FILE_GZIP) { - diffprog = ZDIFF_PATH; - } - args[] = {diffprog, f1, f2, (char *) 0}; + char *args[] = {diffprog, f1, f2, (char *) 0}; execv(diffprog, args); - /* If execv() fails, sdiff's execution will continue. */ - sprintf(stderr, "Could not execute diff process.\n"); - exit(1); + + /* If execv() fails, sdiff's execution will continue below. */ + errx(1, "Could not execute diff process.\n"); } /*