Date: Sat, 18 Aug 2012 22:38:59 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r240506 - soc2012/jhagewood/sdiff Message-ID: <20120818223859.CB334106564A@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhagewood Date: Sat Aug 18 22:38:59 2012 New Revision: 240506 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240506 Log: Modified: soc2012/jhagewood/sdiff/decompress.c soc2012/jhagewood/sdiff/sdiff.c Modified: soc2012/jhagewood/sdiff/decompress.c ============================================================================== --- soc2012/jhagewood/sdiff/decompress.c Sat Aug 18 22:04:52 2012 (r240505) +++ soc2012/jhagewood/sdiff/decompress.c Sat Aug 18 22:38:59 2012 (r240506) @@ -86,17 +86,3 @@ return file; } - -/* Checks for a gz file extension. */ -int -isgzip(char *filename) -{ - - int length = (sizeof filename)-1; - - if (filename[length-1] == 'g' && filename[length] == 'z') - return 1; - - return 0; - -} Modified: soc2012/jhagewood/sdiff/sdiff.c ============================================================================== --- soc2012/jhagewood/sdiff/sdiff.c Sat Aug 18 22:04:52 2012 (r240505) +++ soc2012/jhagewood/sdiff/sdiff.c Sat Aug 18 22:38:59 2012 (r240506) @@ -62,7 +62,6 @@ }; extern FILE *decompressfile(char *, char *); -extern int isgzip(char *); static void astrcat(char **, const char *); static void enqueue(char *, char, char *); @@ -444,14 +443,7 @@ /* Open pipe to diff command. */ if ((diffpipe = fdopen(fd[0], "r")) == NULL) err(2, "could not open diff pipe"); - } - - /* Checks for file extension to determine behavior. */ - if (isgzip(filename1) || isgzip(filename2)) - filebehave = FILE_GZIP; - else - filebehave = FILE_NORMAL; - + } if (filebehave == FILE_NORMAL) { if ((file1 = fopen(filename1, "r")) == NULL) err(2, "could not open %s", filename1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120818223859.CB334106564A>