Update of xzgv to new version 0.9 - uses gtk+2 now - $HOMEPAGE and $MASTER_SITES have changed - get rid of some fixes that should be sent to original author
please test and commit. Regards, Julian
Index: Makefile =================================================================== RCS file: /cvs/ports/graphics/xzgv/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- Makefile 17 Jul 2007 12:45:49 -0000 1.5 +++ Makefile 24 Feb 2009 13:03:45 -0000 @@ -1,39 +1,35 @@ # $OpenBSD: Makefile,v 1.5 2007/07/17 12:45:49 ajacoutot Exp $ COMMENT= picture viewer for X, with thumbnail-based file selector -DISTNAME= xzgv-0.8 -PKGNAME= ${DISTNAME}p1 +DISTNAME= xzgv-0.9 CATEGORIES= graphics -HOMEPAGE= http://rus.members.beeb.net/xzgv.html +HOMEPAGE= http://xzgv.sourceforge.net/ MAINTAINER= Julian Leyh <jul...@vgai.de> -PATCHFILES= xzgv-0.8-integer-overflow-fix.diff:0 -PATCH_DIST_STRIP= -p1 - # GPL PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -MASTER_SITES= ftp://ftp.ibiblio.org/pub/Linux/apps/graphics/viewers/X/ -MASTER_SITES0= http://rus.members.beeb.net/ +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=xzgv/} MODULES= devel/gettext -LIB_DEPENDS= gdk_imlib.>=19::graphics/imlib +LIB_DEPENDS+= gdk-x11-2.0.>=0.11,gdk_pixbuf-2.0.>=0.11,gtk-x11-2.0.>=0.11::x11/gtk+2 + +WANTLIB+= X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext Xfixes +WANTLIB+= Xi Xinerama Xrandr Xrender atk-1.0 c cairo expat fontconfig +WANTLIB+= freetype gio-2.0 glib-2.0 glitz gmodule-2.0 gobject-2.0 m pango-1.0 +WANTLIB+= pangocairo-1.0 pangoft2-1.0 pixman-1 png z -WANTLIB= X11 Xext Xi c gdk glib gmodule gtk jpeg m png tiff \ - ungif z USE_X11= Yes NO_REGRESS= Yes pre-configure: - @perl -pi -e 's,!!SYSCONFDIR!!,${SYSCONFDIR},g;' \ - -e 's,!!LOCALBASE!!,${LOCALBASE},g' \ - ${WRKSRC}/doc/xzgv.1 ${WRKSRC}/doc/xzgv.texi + @${SUBST_CMD} ${WRKSRC}/doc/xzgv.1 ${WRKSRC}/doc/xzgv.texi .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/graphics/xzgv/distinfo,v retrieving revision 1.4 diff -u -r1.4 distinfo --- distinfo 17 Jul 2007 12:45:49 -0000 1.4 +++ distinfo 24 Feb 2009 13:03:45 -0000 @@ -1,10 +1,5 @@ -MD5 (xzgv-0.8-integer-overflow-fix.diff) = lJXoIweUXAhZmgvZ/8L09g== -MD5 (xzgv-0.8.tar.gz) = 45InfxRHB2QC3y49nngssg== -RMD160 (xzgv-0.8-integer-overflow-fix.diff) = vXXIfPbyDk+idXr+RyER4iU8tkA= -RMD160 (xzgv-0.8.tar.gz) = 42RmpzwnYWYQ/QMrOpKJjZWlWhc= -SHA1 (xzgv-0.8-integer-overflow-fix.diff) = sY39qv4pXixCdk9ZeEtrYgG0ieo= -SHA1 (xzgv-0.8.tar.gz) = GqITNuJWKEnm9fmEy7/LdFSJ3zs= -SHA256 (xzgv-0.8-integer-overflow-fix.diff) = yKAeI0zAzjoLnxuZ03gb4OrsZcKE3DdSpoy5KaHa9x8= -SHA256 (xzgv-0.8.tar.gz) = T2JHZl38Pk03b0Vzebnkx3wqhIZZ/ysN1Td8CqCeWIQ= -SIZE (xzgv-0.8-integer-overflow-fix.diff) = 6374 -SIZE (xzgv-0.8.tar.gz) = 302801 +MD5 (xzgv-0.9.tar.gz) = fi361ZXJfCq7s5K2HqafGw== +RMD160 (xzgv-0.9.tar.gz) = fDKE6sWgo2jbG+Lth/iC4m05+rc= +SHA1 (xzgv-0.9.tar.gz) = XYEVyHvjg22e0126d3zR3EhUFxU= +SHA256 (xzgv-0.9.tar.gz) = xXFplCkN+kla1SKQScUQMy1q/ToHJ7Nd45Q2trU9EJE= +SIZE (xzgv-0.9.tar.gz) = 235367 Index: patches/patch-Makefile =================================================================== RCS file: /cvs/ports/graphics/xzgv/patches/patch-Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 patch-Makefile --- patches/patch-Makefile 22 May 2005 11:32:11 -0000 1.1.1.1 +++ patches/patch-Makefile 24 Feb 2009 13:03:45 -0000 @@ -1,24 +1,17 @@ -$OpenBSD: patch-Makefile,v 1.1.1.1 2005/05/22 11:32:11 alek Exp $ ---- Makefile.orig Tue Sep 16 14:58:30 2003 -+++ Makefile Thu May 12 16:00:02 2005 -@@ -24,30 +24,24 @@ VERS=0.8 +$OpenBSD$ +--- Makefile.orig Sun Sep 9 20:12:48 2007 ++++ Makefile Wed Oct 22 09:17:28 2008 +@@ -23,7 +23,7 @@ VERS=0.9 --all: src man infowarn +-all: src man +all: src man info --src: xzgv src/install-info -+src: xzgv + src: xzgv - # We try this the whole time, as the dependancies are a bit - # complicated to duplicate here. - xzgv: - cd src && $(MAKE) xzgv +@@ -37,14 +37,11 @@ src/install-info: src/install-info.c --src/install-info: src/install-info.c -- cd src && $(MAKE) install-info -- man: doc/xzgv.1 -doc/xzgv.1: doc/xzgv.texi doc/makeman.awk @@ -26,8 +19,6 @@ - # Like in GNU stuff, info files aren't automatically remade, # as I don't want to assume everyone has texinfo's `makeinfo' handy. - # So the `infowarn' below is mainly to warn me if the info gets - # out of date. :-) -info: doc/xzgv.gz +info: doc/xzgv.info @@ -35,4 +26,4 @@ +doc/xzgv.info: doc/xzgv.texi cd doc && $(MAKE) info - # Warn if the info is out of date. This *is* automatically done. + clean: Index: patches/patch-config_mk =================================================================== RCS file: /cvs/ports/graphics/xzgv/patches/patch-config_mk,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 patch-config_mk --- patches/patch-config_mk 22 May 2005 11:32:11 -0000 1.1.1.1 +++ patches/patch-config_mk 24 Feb 2009 13:03:45 -0000 @@ -1,38 +1,28 @@ -$OpenBSD: patch-config_mk,v 1.1.1.1 2005/05/22 11:32:11 alek Exp $ ---- config.mk.orig Mon Jan 8 05:57:44 2001 -+++ config.mk Sun May 22 13:21:39 2005 -@@ -6,8 +6,6 @@ +$OpenBSD$ +--- config.mk.orig Sun Aug 12 12:14:42 2007 ++++ config.mk Wed Oct 29 14:46:43 2008 +@@ -6,8 +6,8 @@ # Set the C compiler to use, and options for it. # This is likely to be what you'll want for most systems: # -CC=gcc -CFLAGS=-O2 -Wall ++#CC=gcc ++#CFLAGS=-O2 -Wall # Set the awk interpreter to use for a script used while compiling. # (This should be a `new' awk, such as gawk or mawk.) -@@ -27,7 +25,7 @@ AWK=awk - # On non-x86-based machines (e.g. Alpha, Sparc, PPC), you should - # comment it out. - # --CFLAGS+=-DINTERP_MMX -+#CFLAGS+=-DINTERP_MMX - - # Set rendering backend to use. Currently only Imlib 1.x is properly - # supported, so leave this alone. :-) -@@ -45,7 +43,6 @@ BACKEND=IMLIB1 +@@ -24,10 +24,10 @@ AWK=awk # MANDIR to directory for man page. # Usually it will be simpler to just set PREFIX. # -PREFIX=/usr/local ++#PREFIX=/usr/local + BINDIR=$(PREFIX)/bin +-INFODIR=$(PREFIX)/share/info +-MANDIR=$(PREFIX)/share/man/man1 ++INFODIR=$(PREFIX)/info ++MANDIR=$(PREFIX)/man/man1 + + # -------------------- Miscellaneous options ----------------------- - # In theory it would be nice to put the info file and man page under - # /usr/local/share. However, it's not clear if this is widely -@@ -90,3 +87,8 @@ MANDIR=$(PREFIX)$(SHARE_INFIX)/man/man1 - # doc/Makefile isn't as smart about that as it should be. :-)) - # - USE_A4_DEF=-t @afourpaper -+ -+# -------------------- Adding missing include paths --------------- -+ -+CFLAGS+=-I${LOCALBASE}/include -+CFLAGS+=-I${LOCALBASE}/include/libpng Index: patches/patch-doc_Makefile =================================================================== RCS file: /cvs/ports/graphics/xzgv/patches/patch-doc_Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 patch-doc_Makefile --- patches/patch-doc_Makefile 22 May 2005 11:32:11 -0000 1.1.1.1 +++ patches/patch-doc_Makefile 24 Feb 2009 13:03:45 -0000 @@ -1,6 +1,6 @@ -$OpenBSD: patch-doc_Makefile,v 1.1.1.1 2005/05/22 11:32:11 alek Exp $ ---- doc/Makefile.orig Thu Dec 21 04:45:20 2000 -+++ doc/Makefile Thu May 12 15:56:37 2005 +$OpenBSD$ +--- doc/Makefile.orig Wed Oct 22 09:10:10 2008 ++++ doc/Makefile Wed Oct 22 09:11:51 2008 @@ -10,7 +10,7 @@ include ../config.mk all: info man @@ -20,33 +20,18 @@ # This explicitly mentions `gawk' because makeman requires it # (and can't easily be made not to, since it really does need gensub). # To avoid problems on gawkless systems, a prebuilt xzgv.1 is included -@@ -36,25 +39,10 @@ xzgv.1: xzgv.texi makeman.awk +@@ -36,10 +39,10 @@ xzgv.1: xzgv.texi makeman.awk installdirs: /bin/sh ../mkinstalldirs $(INFODIR) $(MANDIR) --install: ../src/install-info installdirs +-install: installdirs - install xzgv.1 $(MANDIR) -- install xzgv.gz xzgv-?.gz $(INFODIR) -- chmod 644 $(MANDIR)/xzgv.1 $(INFODIR)/xzgv* --# Update info `dir' file. --# Info always uses a dir file in preference to a dir.gz, so we don't use --# dir.gz unless it's the only game in town. -- if [ "$(INFO_DIR_UPDATE)" != no ]; then \ -- gzip -d xzgv.gz; \ -- if [ -f $(INFODIR)/dir.gz -a ! -f $(INFODIR)/dir ]; then \ -- gzip -d $(INFODIR)/dir.gz; \ -- ../src/install-info xzgv $(INFODIR)/dir; \ -- gzip $(INFODIR)/dir; \ -- else \ -- ../src/install-info xzgv $(INFODIR)/dir; \ -- fi; \ -- chmod a+r $(INFODIR)/dir; \ -- gzip xzgv; \ -- fi +- install xzgv.gz $(INFODIR) +- install-info --infodir=$(INFODIR) xzgv.gz +install: + ${BSD_INSTALL_MAN} xzgv.1 ${MANDIR} + ${BSD_INSTALL_DATA} xzgv.info ${INFODIR} + install-info ${INFODIR}/xzgv.info ${INFODIR}/dir - ../src/install-info: ../src/install-info.c - cd ../src && $(MAKE) install-info + uninstall: + $(RM) $(MANDIR)/xzgv.1 Index: patches/patch-doc_xzgv_1 =================================================================== RCS file: /cvs/ports/graphics/xzgv/patches/patch-doc_xzgv_1,v retrieving revision 1.1 diff -u -r1.1 patch-doc_xzgv_1 --- patches/patch-doc_xzgv_1 17 Jul 2007 12:45:49 -0000 1.1 +++ patches/patch-doc_xzgv_1 24 Feb 2009 13:03:45 -0000 @@ -1,24 +1,24 @@ -$OpenBSD: patch-doc_xzgv_1,v 1.1 2007/07/17 12:45:49 ajacoutot Exp $ ---- doc/xzgv.1.orig Tue Sep 16 15:19:44 2003 -+++ doc/xzgv.1 Tue Jul 17 14:32:29 2007 -@@ -2120,9 +2120,9 @@ configuration file. +$OpenBSD$ +--- doc/xzgv.1.orig Sun Sep 9 20:27:30 2007 ++++ doc/xzgv.1 Wed Oct 29 14:38:21 2008 +@@ -2119,9 +2119,9 @@ configuration file. .SH "CONFIG FILES" A configuration file lets you alter aspects of xzgv's behaviour. xzgv supports two possible config files --- a system-wide one, -\fI/etc/xzgv.conf\fR; and one for each user in their home directory, -+\fI!!SYSCONFDIR!!/xzgv.conf\fR; and one for each user in their home directory, ++\fI${SYSCONFDIR}/xzgv.conf\fR; and one for each user in their home directory, \fI$HOME/.xzgvrc\fR. Both are optional. If \fI$HOME/.xzgvrc\fR exists, -it is used \fIinstead of\fR \fI/etc/xzgv.conf\fR. -+it is used \fIinstead of\fR \fI!!SYSCONFDIR!!/xzgv.conf\fR. ++it is used \fIinstead of\fR \fI${SYSCONFDIR}/xzgv.conf\fR. .PP Before describing the format of config files, it may help to give an example file: -@@ -2453,7 +2453,7 @@ The versions of GTK+ and Imlib you are using. `\fBxzgv +@@ -2444,7 +2444,7 @@ The versions of GTK+ and Imlib you are using. `\fBxzgv reports the GTK+ version being used by xzgv, but Imlib is a little more tricky --- `\fBimlib-config --version\fR' should work if you have a full Imlib installation, but failing that, try `\fBls -l -/usr/lib/libImlib*\fR' or `\fBls -l /usr/X11R6/lib/libImlib*\fR'. -+!!LOCALBASE!!/lib/libImlib*\fR'. ++${LOCALBASE}/lib/libImlib*\fR'. .PP \fBo\fR The bitdepth your X server is running in (common depths are 8-bit (256 Index: patches/patch-doc_xzgv_texi =================================================================== RCS file: /cvs/ports/graphics/xzgv/patches/patch-doc_xzgv_texi,v retrieving revision 1.1 diff -u -r1.1 patch-doc_xzgv_texi --- patches/patch-doc_xzgv_texi 17 Jul 2007 12:45:49 -0000 1.1 +++ patches/patch-doc_xzgv_texi 24 Feb 2009 13:03:45 -0000 @@ -1,24 +1,24 @@ -$OpenBSD: patch-doc_xzgv_texi,v 1.1 2007/07/17 12:45:49 ajacoutot Exp $ ---- doc/xzgv.texi.orig Tue Jul 17 14:40:55 2007 -+++ doc/xzgv.texi Tue Jul 17 14:41:37 2007 -@@ -2723,9 +2723,9 @@ configuration file. +$OpenBSD$ +--- doc/xzgv.texi.orig Sun Sep 9 20:27:28 2007 ++++ doc/xzgv.texi Wed Oct 29 14:38:46 2008 +@@ -2714,9 +2714,9 @@ configuration file. A configuration file lets you alter aspects of xzgv's behaviour. xzgv supports two possible config files --- a system-wide one, -...@file{/etc/xzgv.conf}; and one for each user in their home directory, -...@file{!!sysconfdir!!/xzgv.conf}; and one for each user in their home directory, +...@file{${sysconfdir}/xzgv.conf}; and one for each user in their home directory, @file{$HOME/.xzgvrc}. Both are optional. If @file{$HOME/.xzgvrc} exists, -it is used @emph{instead of} @file{/etc/xzgv.conf}. -+it is used @emph{instead of} @file{!!SYSCONFDIR!!/xzgv.conf}. ++it is used @emph{instead of} @file{${SYSCONFDIR}/xzgv.conf}. Before describing the format of config files, it may help to give an example file: -@@ -3171,7 +3171,7 @@ The versions of GTK+ and Imlib you are using. @code{xz +@@ -3152,7 +3152,7 @@ The versions of GTK+ and Imlib you are using. @code{xz reports the GTK+ version being used by xzgv, but Imlib is a little more tricky --- @code{imlib-config --version} should work if you have a full Imlib installation, but failing that, try @code{ls -l -/usr/lib/libImlib*} or @code{ls -l /usr/X11R6/lib/libImlib*}. -+!!LOCALBASE!!/lib/libImlib*}. ++${LOCALBASE}/lib/libImlib*}. @item The bitdepth your X server is running in (common depths are 8-bit (256 Index: patches/patch-src_Makefile =================================================================== RCS file: /cvs/ports/graphics/xzgv/patches/patch-src_Makefile,v retrieving revision 1.2 diff -u -r1.2 patch-src_Makefile --- patches/patch-src_Makefile 17 Jul 2007 12:45:49 -0000 1.2 +++ patches/patch-src_Makefile 24 Feb 2009 13:03:45 -0000 @@ -1,16 +1,7 @@ -$OpenBSD: patch-src_Makefile,v 1.2 2007/07/17 12:45:49 ajacoutot Exp $ ---- src/Makefile.orig Tue Jul 17 14:26:28 2007 -+++ src/Makefile Tue Jul 17 14:26:29 2007 -@@ -30,7 +30,7 @@ BACKEND_LIBS=`case "$(BACKEND)" in \ - # compile when you do `make install'. :-) - # (It would also be weird to have it made by the `doc' Makefile, IMHO.) - --all: xzgv install-info -+all: xzgv - - OBJS= main.o \ - filedetails.o gotodir.o updatetn.o confirm.o help.o \ -@@ -57,9 +57,8 @@ install-info: install-info.c getopt.o getopt1.o +$OpenBSD$ +--- src/Makefile.orig Wed Oct 22 09:06:32 2008 ++++ src/Makefile Wed Oct 22 09:07:32 2008 +@@ -28,9 +28,8 @@ xzgv: $(OBJS) installdirs: /bin/sh ../mkinstalldirs $(BINDIR) @@ -18,7 +9,7 @@ - install xzgv $(BINDIR) - chmod 755 $(BINDIR)/xzgv +install: xzgv -+ ${BSD_INSTALL_PROGRAM} xzgv $(BINDIR) ++ $(BSD_INSTALL_PROGRAM) xzgv $(BINDIR) uninstall: $(RM) $(BINDIR)/xzgv Index: patches/patch-src_backend_c =================================================================== RCS file: patches/patch-src_backend_c diff -N patches/patch-src_backend_c --- patches/patch-src_backend_c 22 May 2005 11:32:11 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-src_backend_c,v 1.1.1.1 2005/05/22 11:32:11 alek Exp $ ---- src/backend.c.orig Thu May 12 15:42:51 2005 -+++ src/backend.c Thu May 12 15:43:10 2005 -@@ -239,7 +239,7 @@ im->rgb_data = rgb; - im->alpha_data = NULL; - - /* Imlib does this next bit for anonymous data... *wretch* */ --g_snprintf(s, sizeof(s), "creat_%lx_%x", time(NULL), rand()); -+g_snprintf(s, sizeof(s), "creat_%lx_%x", (long unsigned int)time(NULL), rand()); - im->filename = strdup(s); - - im->width = 0; Index: patches/patch-src_copymove_c =================================================================== RCS file: patches/patch-src_copymove_c diff -N patches/patch-src_copymove_c --- patches/patch-src_copymove_c 14 Nov 2005 17:09:22 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,65 +0,0 @@ -$OpenBSD: patch-src_copymove_c,v 1.2 2005/11/14 17:09:22 pvalchev Exp $ ---- src/copymove.c.orig Thu Nov 16 15:59:48 2000 -+++ src/copymove.c Thu May 12 15:31:52 2005 -@@ -57,15 +57,17 @@ if(!cm_isdir(dstdir)) return(0); - if((in=fopen(src,"rb"))==NULL) - return(0); - --if((dst=malloc(strlen(dstdir)+strlen(src)+2))==NULL) /* +2 for / and NUL */ -+siz=strlen(dstdir)+strlen(src)+1; /* +2 for / and NUL */ -+ -+if((dst=malloc(siz))==NULL) - return(0); - --strcpy(dst,dstdir); --strcat(dst,"/"); -+strlcpy(dst,dstdir,siz); -+strlcat(dst,"/",siz); - if(strrchr(src,'/')) -- strcat(dst,strrchr(src,'/')+1); -+ strlcat(dst,strrchr(src,'/')+1,siz); - else -- strcat(dst,src); -+ strlcat(dst,src,siz); - - /* check it doesn't already exist */ - if((out=fopen(dst,"rb"))!=NULL) -@@ -114,18 +116,21 @@ int movefile(char *src,char *dstdir) - struct stat sbuf; - struct utimbuf utbuf; - char *dst; -+int siz; - - if(!cm_isdir(dstdir)) return(0); - --if((dst=malloc(strlen(dstdir)+strlen(src)+2))==NULL) /* +2 for / and NUL */ -+siz=strlen(dstdir)+strlen(src)+2; /* +2 for / and NUL */ -+ -+if((dst=malloc(siz))==NULL) - return(0); - --strcpy(dst,dstdir); --strcat(dst,"/"); -+strlcpy(dst,dstdir,siz); -+strlcat(dst,"/",siz); - if(strrchr(src,'/')) -- strcat(dst,strrchr(src,'/')+1); -+ strlcat(dst,strrchr(src,'/')+1,siz); - else -- strcat(dst,src); -+ strlcat(dst,src,siz); - - /* fail if dest file already exists */ - if(stat(dst,&sbuf)==0) -@@ -328,9 +333,9 @@ for(done=f=0;f<numrows;f++) - - if(!(*copy_or_move_ptr)(ptr,destdir)) - { -- sprintf(buf,"Error %s ",cm_do_move?"moving":"copying"); -+ snprintf(buf,sizeof(buf),"Error %s ",cm_do_move?"moving":"copying"); - /* if it's a really big filename just say "file" :-) */ -- strcat(buf,(strlen(ptr)>100)?"file":ptr); -+ strlcat(buf,(strlen(ptr)>100)?"file":ptr,sizeof(buf)); - - if(mainwin) - { Index: patches/patch-src_filedetails_c =================================================================== RCS file: patches/patch-src_filedetails_c diff -N patches/patch-src_filedetails_c --- patches/patch-src_filedetails_c 17 Jul 2007 12:45:49 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,79 +0,0 @@ -$OpenBSD: patch-src_filedetails_c,v 1.2 2007/07/17 12:45:49 ajacoutot Exp $ ---- src/filedetails.c.orig Sat Nov 18 18:58:39 2000 -+++ src/filedetails.c Tue Jul 17 14:26:29 2007 -@@ -26,7 +26,7 @@ static char buf[10]; - int f,shift,submode; - char *execptr; - --strcpy(buf,"---------"); -+strlcpy(buf,"---------",sizeof(buf)); - - for(f=0,shift=6;f<3;f++,shift-=3) - { -@@ -73,14 +73,14 @@ char *ptr; - - if((ptr=strrchr(filename,'/'))==NULL) - { -- strcpy(buf,".xvpics/"); -- strcat(buf,filename); -+ strlcpy(buf,".xvpics/",sizeof(buf)); -+ strlcat(buf,filename,sizeof(buf)); - } - else - { -- strcpy(buf,filename); -- strcpy(strrchr(buf,'/')+1,".xvpics/"); -- strcat(buf,ptr+1); -+ strlcpy(buf,filename,sizeof(buf)); -+ strlcat(buf,".xvpics/",sizeof(buf)); -+ strlcat(buf,ptr+1,sizeof(buf)); - } - - if((tn=fopen(buf,"rb"))!=NULL) -@@ -174,11 +174,11 @@ DO_TBL_LEFT(os_tbl,tbl_row,"Filename:"); - DO_TBL_RIGHT(os_tbl,tbl_row,filename); - tbl_row++; - --strcpy(buf,"unknown"); -+strlcpy(buf,"unknown",sizeof(buf)); - - DO_TBL_LEFT(os_tbl,tbl_row,"Size:"); - if(got_stat_info) -- sprintf(buf,"%d (%dk)",(int)sbuf.st_size,((int)sbuf.st_size+1023)/1024); -+ snprintf(buf,sizeof(buf),"%d (%dk)",(int)sbuf.st_size,((int)sbuf.st_size+1023)/1024); - DO_TBL_RIGHT(os_tbl,tbl_row,buf); - tbl_row++; - -@@ -186,9 +186,9 @@ DO_TBL_LEFT(os_tbl,tbl_row,"Last modified:"); - if(got_stat_info) - { - if((ctime=localtime(&sbuf.st_mtime))==NULL) /* can't happen? */ -- strcpy(buf,"unknown"); -+ strlcpy(buf,"unknown",sizeof(buf)); - else -- sprintf(buf,"%d-%02d-%02d %02d:%02d", -+ snprintf(buf,sizeof(buf),"%d-%02d-%02d %02d:%02d", - 1900+ctime->tm_year,ctime->tm_mon+1,ctime->tm_mday, - ctime->tm_hour,ctime->tm_min); - } -@@ -197,7 +197,7 @@ tbl_row++; - - DO_TBL_LEFT(os_tbl,tbl_row,"Permissions:"); - if(got_stat_info) -- sprintf(buf,"%s (%o)", -+ snprintf(buf,sizeof(buf),"%s (%o)", - make_perms_string(sbuf.st_mode&07777),sbuf.st_mode&07777); - DO_TBL_RIGHT(os_tbl,tbl_row,buf); - tbl_row++; -@@ -232,9 +232,9 @@ tbl_row=0; - - DO_TBL_LEFT(tn_tbl,tbl_row,"Dimensions:"); - if(got_dimensions) -- sprintf(buf,"%d x %d",w,h); -+ snprintf(buf,sizeof(buf),"%d x %d",w,h); - else -- strcpy(buf,"unknown"); -+ strlcpy(buf,"unknown",sizeof(buf)); - DO_TBL_RIGHT(tn_tbl,tbl_row,buf); - tbl_row++; - Index: patches/patch-src_help_c =================================================================== RCS file: patches/patch-src_help_c diff -N patches/patch-src_help_c --- patches/patch-src_help_c 17 Jul 2007 12:45:49 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,45 +0,0 @@ -$OpenBSD: patch-src_help_c,v 1.2 2007/07/17 12:45:49 ajacoutot Exp $ ---- src/help.c.orig Tue Sep 16 16:07:44 2003 -+++ src/help.c Tue Jul 17 14:26:29 2007 -@@ -84,8 +84,9 @@ void help_run(char *node) - char *cmd_start="xterm -e info '(xzgv)"; - char *cmd_end="' &"; - char *buf; -+int siz = strlen(cmd_start)+strlen(node)+strlen(cmd_end)+1; - --if((buf=malloc(strlen(cmd_start)+strlen(node)+strlen(cmd_end)+1))==NULL) -+if((buf=malloc(siz))==NULL) - { - /* if we're *that* low on memory, then error_dialog() will fail too, - * so just return. -@@ -93,9 +94,9 @@ if((buf=malloc(strlen(cmd_start)+strlen(node)+strlen(c - return; - } - --strcpy(buf,cmd_start); --strcat(buf,node); --strcat(buf,cmd_end); -+strlcpy(buf,cmd_start,siz); -+strlcat(buf,node,siz); -+strlcat(buf,cmd_end,siz); - - /* XXX it turns out the error check is useless, as the `&' leads to - * starting another shell which is the one to give any errors. The -@@ -106,13 +107,14 @@ if(system(buf)!=0) - { - char *msg="Couldn't run help command:\n"; - char *buf2; -+ int siz=strlen(msg)+strlen(buf)+1; - -- if((buf2=malloc(strlen(msg)+strlen(buf)+1))==NULL) -+ if((buf2=malloc(siz))==NULL) - error_dialog("xzgv error",msg); - else - { -- strcpy(buf2,msg); -- strcat(buf2,buf); -+ strlcpy(buf2,msg,siz); -+ strlcat(buf2,buf,siz); - error_dialog("xzgv error",buf2); - free(buf2); - } Index: patches/patch-src_install-info_c =================================================================== RCS file: patches/patch-src_install-info_c diff -N patches/patch-src_install-info_c --- patches/patch-src_install-info_c 14 Nov 2005 17:09:22 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-src_install-info_c,v 1.2 2005/11/14 17:09:22 pvalchev Exp $ ---- src/install-info.c.orig Thu May 12 15:09:12 2005 -+++ src/install-info.c Thu May 12 15:26:28 2005 -@@ -166,12 +166,12 @@ concat (s1, s2, s3) - char *s1, *s2, *s3; - { - int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); -- char *result = (char *) xmalloc (len1 + len2 + len3 + 1); -+ int siz=strlen(s1)+strlen(s2)+strlen(s3)+1; -+ char *result = (char *) xmalloc (siz); - -- strcpy (result, s1); -- strcpy (result + len1, s2); -- strcpy (result + len1 + len2, s3); -- *(result + len1 + len2 + len3) = 0; -+ strlcpy (result, s1, siz); -+ strlcat (result, s2, siz); -+ strlcat (result, s3, siz); - - return result; - } Index: patches/patch-src_logoconv_c =================================================================== RCS file: patches/patch-src_logoconv_c diff -N patches/patch-src_logoconv_c --- patches/patch-src_logoconv_c 14 Nov 2005 17:09:22 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -$OpenBSD: patch-src_logoconv_c,v 1.2 2005/11/14 17:09:22 pvalchev Exp $ ---- src/logoconv.c.orig Sat Oct 7 15:25:25 2000 -+++ src/logoconv.c Thu May 12 15:35:40 2005 -@@ -10,6 +10,7 @@ - #include <stdio.h> - #include <stdlib.h> - #include <ctype.h> -+#include <string.h> - - - /* we take an extremely generous outlook - anything other than a decimal Index: patches/patch-src_main_c =================================================================== RCS file: patches/patch-src_main_c diff -N patches/patch-src_main_c --- patches/patch-src_main_c 17 Jul 2007 12:45:49 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,150 +0,0 @@ -$OpenBSD: patch-src_main_c,v 1.3 2007/07/17 12:45:49 ajacoutot Exp $ ---- src/main.c.orig Tue Sep 16 15:49:01 2003 -+++ src/main.c Tue Jul 17 14:26:29 2007 -@@ -3007,25 +3007,25 @@ if(l<=4) return(0); - * natively, and uses ImageMagick's `convert' for others. - * But we have our own GIF/PNG/mrf readers. - */ --if((!strcasecmp(filename+l-4,".gif")) || -- (!strcasecmp(filename+l-4,".jpg")) || -- (!strcasecmp(filename+l-5,".jpeg")) || -- (!strcasecmp(filename+l-4,".png")) || -- (!strcasecmp(filename+l-4,".mrf")) || -- (!strcasecmp(filename+l-4,".xbm")) || -- (!strcasecmp(filename+l-5,".icon")) || /* presumably an XBM */ -- (!strcasecmp(filename+l-4,".xpm")) || -- (!strcasecmp(filename+l-4,".pbm")) || -- (!strcasecmp(filename+l-4,".pgm")) || -- (!strcasecmp(filename+l-4,".ppm")) || -- (!strcasecmp(filename+l-4,".bmp")) || -- (!strcasecmp(filename+l-4,".tga")) || -- (!strcasecmp(filename+l-4,".pcx")) || -- (!strcasecmp(filename+l-4,".tif")) || -- (!strcasecmp(filename+l-5,".tiff")) || -- (!strcasecmp(filename+l-4,".prf")) || -- (!strcasecmp(filename+l-4,".tim")) || -- (!strcasecmp(filename+l-4,".xwd"))) -+if((!strncasecmp(filename+l-4,".gif",5)) || -+ (!strncasecmp(filename+l-4,".jpg",5)) || -+ (!strncasecmp(filename+l-5,".jpeg",6)) || -+ (!strncasecmp(filename+l-4,".png",5)) || -+ (!strncasecmp(filename+l-4,".mrf",5)) || -+ (!strncasecmp(filename+l-4,".xbm",5)) || -+ (!strncasecmp(filename+l-5,".icon",6)) || /* presumably an XBM */ -+ (!strncasecmp(filename+l-4,".xpm",5)) || -+ (!strncasecmp(filename+l-4,".pbm",5)) || -+ (!strncasecmp(filename+l-4,".pgm",5)) || -+ (!strncasecmp(filename+l-4,".ppm",5)) || -+ (!strncasecmp(filename+l-4,".bmp",5)) || -+ (!strncasecmp(filename+l-4,".tga",5)) || -+ (!strncasecmp(filename+l-4,".pcx",5)) || -+ (!strncasecmp(filename+l-4,".tif",5)) || -+ (!strncasecmp(filename+l-5,".tiff",6)) || -+ (!strncasecmp(filename+l-4,".prf",5)) || -+ (!strncasecmp(filename+l-4,".tim",5)) || -+ (!strncasecmp(filename+l-4,".xwd",5))) - return(1); - else - return(0); -@@ -3090,8 +3090,8 @@ for(f=0;f<IDLE_XVPIC_NUM_PER_CALL;f++) - { - /* construct filename for file's (possible) thumbnail */ - gtk_clist_get_text(GTK_CLIST(clist),*entryp,SELECTOR_NAME_COL,&ptr); -- strcpy(buf,".xvpics/"); -- strncat(buf,ptr,sizeof(buf)-8-2); /* above string is 8 chars long */ -+ strlcpy(buf,".xvpics/",sizeof(buf)); -+ strlcat(buf,ptr,sizeof(buf)); - - datptr=gtk_clist_get_row_data(GTK_CLIST(clist),*entryp); - -@@ -3433,10 +3433,10 @@ void set_title(int include_dir) - { - static char buf[1024]; - --strcpy(buf,"xzgv"); -+strlcpy(buf,"xzgv",sizeof(buf)); - if(include_dir) - { -- strcat(buf,": "); -+ strlcat(buf,": ",sizeof(buf)); - getcwd(buf+strlen(buf),sizeof(buf)-strlen(buf)-2); - } - -@@ -3574,6 +3574,7 @@ static char *prefix=".xvpics/"; - char *ptr,*tn; - int row; - int was_reading=0; -+int siz; - - row=GTK_CLIST(clist)->focus_row; - gtk_clist_get_text(GTK_CLIST(clist),row,SELECTOR_NAME_COL,&ptr); -@@ -3590,9 +3591,10 @@ cb_back_to_clist(); - /* construct thumbnail filename early, as we're about to delete - * the row containing the filename itself. - */ --tn=malloc(strlen(prefix)+strlen(ptr)+1); -+siz=strlen(prefix)+strlen(ptr)+1; -+tn=malloc(siz); - if(tn) -- strcpy(tn,prefix),strcat(tn,ptr); -+ strlcpy(tn,prefix,siz),strlcat(tn,ptr,siz); - - /* remove the row in the clist. We need to stop/restart thumbnail read - * if it's running, as unexpectedly losing a row midway through could -@@ -3634,6 +3636,7 @@ static char *prefix="Really delete `",*suffix="'?"; - struct clist_data_tag *datptr; - char *ptr,*msg; - int row; -+int siz; - - row=GTK_CLIST(clist)->focus_row; - if(row<0 || row>=numrows) return; -@@ -3644,12 +3647,13 @@ if(!ptr) return; - datptr=gtk_clist_get_row_data(GTK_CLIST(clist),row); - if(!datptr || datptr->isdir) return; - --msg=malloc(strlen(ptr)+strlen(prefix)+strlen(suffix)+1); -+siz=strlen(ptr)+strlen(prefix)+strlen(suffix)+1; -+msg=malloc(siz); - if(!msg) return; - --strcpy(msg,prefix); --strcat(msg,ptr); --strcat(msg,suffix); -+strlcpy(msg,prefix,siz); -+strlcat(msg,ptr,siz); -+strlcat(msg,suffix,siz); - - /* ok, check if they're sure. If so, the above callback routine - * will be called. -@@ -3667,6 +3671,7 @@ void reinit_dir(int do_pastpos,int try_to_save_cursor_ - { - int row; - char *ptr,*oldname=NULL; -+int siz; - - if(do_pastpos && try_to_save_cursor_pos) - fprintf(stderr,"xzgv: both args to reinit_dir() set, bug alert :-)\n"), -@@ -3676,10 +3681,11 @@ if(try_to_save_cursor_pos) - { - gtk_clist_get_text(GTK_CLIST(clist),GTK_CLIST(clist)->focus_row, - SELECTOR_NAME_COL,&ptr); -- if(!ptr || (oldname=malloc(strlen(ptr)+1))==NULL) -+ siz=strlen(ptr)+1; -+ if(!ptr || (oldname=malloc(siz))==NULL) - try_to_save_cursor_pos=0; - else -- strcpy(oldname,ptr); -+ strlcpy(oldname,ptr,siz); - } - - blast_clist(); -@@ -4587,7 +4593,7 @@ int f,siz=logo_w*logo_h*3,c; - unsigned char *ptr=logo_data; - - /* invert it */ --for(f=0;f<siz;f++) *ptr++=255-*ptr; -+for(f=0;f<siz;f++,ptr++) *ptr=255-*ptr; - - /* ok, now kludge it :-) - the black right/bottom edge turns to white, - * which is too bright. Make that the same as the grey line above/left of it. Index: patches/patch-src_rcfile_c =================================================================== RCS file: patches/patch-src_rcfile_c diff -N patches/patch-src_rcfile_c --- patches/patch-src_rcfile_c 22 May 2005 11:32:11 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-src_rcfile_c,v 1.1.1.1 2005/05/22 11:32:11 alek Exp $ ---- src/rcfile.c.orig Thu May 12 15:39:58 2005 -+++ src/rcfile.c Thu May 12 15:40:18 2005 -@@ -209,7 +209,7 @@ in_config=1; - - *cfgfile=0; - if(home && strlen(home)<sizeof(cfgfile)-strlen("/.xzgvrc")-1) -- sprintf(cfgfile,"%s/.xzgvrc",home); -+ snprintf(cfgfile,sizeof(cfgfile),"%s/.xzgvrc",home); - - if((in=fopen(cfgfile,"r"))!=NULL) - got_rcfile=1,config_file_name="~/.xzgvrc"; /* shortened name for that */ Index: patches/patch-src_rename_c =================================================================== RCS file: patches/patch-src_rename_c diff -N patches/patch-src_rename_c --- patches/patch-src_rename_c 17 Jul 2007 12:45:49 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,39 +0,0 @@ -$OpenBSD: patch-src_rename_c,v 1.2 2007/07/17 12:45:49 ajacoutot Exp $ ---- src/rename.c.orig Thu Nov 16 15:59:14 2000 -+++ src/rename.c Tue Jul 17 14:26:29 2007 -@@ -28,6 +28,7 @@ static void cb_ok_button(GtkWidget *button,GtkWidget * - struct stat sbuf; - char *tn_src,*tn_dst; - char *dest=g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); -+int src_len,dst_len; - - gtk_widget_destroy(rename_win); - -@@ -64,8 +65,10 @@ if(rename(oldname,dest)==-1) - tn_src=tn_dst=NULL; - - /* ".xvpics/" is 8 chars */ --if((tn_src=malloc(8+strlen(oldname)+1))==NULL || -- (tn_dst=malloc(8+strlen(dest)+1))==NULL) -+src_len=8+strlen(oldname)+1; -+dst_len=8+strlen(dest)+1; -+if((tn_src=malloc(src_len))==NULL || -+ (tn_dst=malloc(dst_len))==NULL) - { - /* rename entry */ - gtk_clist_set_text(GTK_CLIST(clist),current_row,SELECTOR_NAME_COL,dest); -@@ -74,10 +77,10 @@ if((tn_src=malloc(8+strlen(oldname)+1))==NULL || - return; - } - --strcpy(tn_src,".xvpics/"); --strcat(tn_src,oldname); --strcpy(tn_dst,".xvpics/"); --strcat(tn_dst,dest); -+strlcpy(tn_src,".xvpics/",src_len); -+strlcat(tn_src,oldname,src_len); -+strlcpy(tn_dst,".xvpics/",dst_len); -+strlcat(tn_dst,dest,dst_len); - - rename(tn_src,tn_dst); /* don't much care if it works or not */ - Index: patches/patch-src_resizepic_c =================================================================== RCS file: patches/patch-src_resizepic_c diff -N patches/patch-src_resizepic_c --- patches/patch-src_resizepic_c 22 May 2005 11:32:11 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -$OpenBSD: patch-src_resizepic_c,v 1.1.1.1 2005/05/22 11:32:11 alek Exp $ ---- src/resizepic.c.orig Thu May 12 14:55:02 2005 -+++ src/resizepic.c Thu May 12 14:55:09 2005 -@@ -6,6 +6,7 @@ - - #include <stdio.h> - #include <stdlib.h> -+#include <string.h> - - #include "resizepic.h" - Index: patches/patch-src_updatetn_c =================================================================== RCS file: patches/patch-src_updatetn_c diff -N patches/patch-src_updatetn_c --- patches/patch-src_updatetn_c 17 Jul 2007 12:45:49 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -$OpenBSD: patch-src_updatetn_c,v 1.2 2007/07/17 12:45:49 ajacoutot Exp $ ---- src/updatetn.c.orig Tue Apr 10 05:47:00 2001 -+++ src/updatetn.c Tue Jul 17 14:26:29 2007 -@@ -168,8 +168,8 @@ datptr=gtk_clist_get_row_data(GTK_CLIST(clist),row); - if(datptr->isdir || stat(ptr,&realpic)==-1 || *ptr=='.') - return(1); - --strcpy(buf,".xvpics/"); --strncat(buf,ptr,sizeof(buf)-8-2); /* above string is 8 chars long */ -+strlcpy(buf,".xvpics/",sizeof(buf)); -+strlcat(buf,ptr,sizeof(buf)); - - /* if not there, or pic is newer, or thumbnail is unreadable, - * make a thumbnail. Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/graphics/xzgv/pkg/PLIST,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 PLIST --- pkg/PLIST 22 May 2005 11:32:11 -0000 1.1.1.1 +++ pkg/PLIST 24 Feb 2009 13:03:45 -0000 @@ -1,4 +1,4 @@ @comment $OpenBSD: PLIST,v 1.1.1.1 2005/05/22 11:32:11 alek Exp $ -bin/xzgv +...@bin bin/xzgv @info info/xzgv.info @man man/man1/xzgv.1