head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.6 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.4 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.2 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.2.0.22 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.2.0.20 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.2.0.18 pkgsrc-2011Q1-base:1.2 pkgsrc-2010Q4:1.2.0.16 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.2.0.14 pkgsrc-2010Q3-base:1.2 pkgsrc-2010Q2:1.2.0.12 pkgsrc-2010Q2-base:1.2 pkgsrc-2010Q1:1.2.0.10 pkgsrc-2010Q1-base:1.2 pkgsrc-2009Q4:1.2.0.8 pkgsrc-2009Q4-base:1.2 pkgsrc-2009Q3:1.2.0.6 pkgsrc-2009Q3-base:1.2 pkgsrc-2009Q2:1.2.0.4 pkgsrc-2009Q2-base:1.2 pkgsrc-2009Q1:1.2.0.2 pkgsrc-2009Q1-base:1.2 pkgsrc-2008Q4:1.1.0.36 pkgsrc-2008Q4-base:1.1 pkgsrc-2008Q3:1.1.0.34 pkgsrc-2008Q3-base:1.1 cube-native-xorg:1.1.0.32 cube-native-xorg-base:1.1 pkgsrc-2008Q2:1.1.0.30 pkgsrc-2008Q2-base:1.1 cwrapper:1.1.0.28 pkgsrc-2008Q1:1.1.0.26 pkgsrc-2008Q1-base:1.1 pkgsrc-2007Q4:1.1.0.24 pkgsrc-2007Q4-base:1.1 pkgsrc-2007Q3:1.1.0.22 pkgsrc-2007Q3-base:1.1 pkgsrc-2007Q2:1.1.0.20 pkgsrc-2007Q2-base:1.1 pkgsrc-2007Q1:1.1.0.18 pkgsrc-2007Q1-base:1.1 pkgsrc-2006Q4:1.1.0.16 pkgsrc-2006Q4-base:1.1 pkgsrc-2006Q3:1.1.0.14 pkgsrc-2006Q3-base:1.1 pkgsrc-2006Q2:1.1.0.12 pkgsrc-2006Q2-base:1.1 pkgsrc-2006Q1:1.1.0.10 pkgsrc-2006Q1-base:1.1 pkgsrc-2005Q4:1.1.0.8 pkgsrc-2005Q4-base:1.1 pkgsrc-2005Q3:1.1.0.6 pkgsrc-2005Q3-base:1.1 pkgsrc-2005Q2:1.1.0.4 pkgsrc-2005Q2-base:1.1 pkgsrc-2005Q1:1.1.0.2 pkgsrc-2005Q1-base:1.1; locks; strict; comment @# @; 1.3 date 2011.10.21.19.37.29; author ryoon; state dead; branches; next 1.2; 1.2 date 2009.02.13.18.53.28; author abs; state Exp; branches; next 1.1; 1.1 date 2005.03.17.12.24.13; author salo; state Exp; branches; next ; desc @@ 1.3 log @Update to 1.6.5.2 * Set LICENSE. * Make pkglint happy Changelog: Summary of changes in enscript version 1.6.5.2: * Fix CFG_FATAL macro in util.c; this prevents a segmentation fault when the configuration file contains unknown parameters. (Savannah bug #28769) * Fix segmentation fault with line lengths over 90 characters. (Savannah bug #29198) Summary of changes in enscript version 1.6.5.1: * Typo corrections in the manual pages. * Reorganise source tree to use a single ChangeLog file. * Actually ship f90.st in the tarball. * Reorganise INSTALL and README. Noteworthy changes in enscript version 1.6.5: * New maintainer. * Licensing change: GNU Enscript is now distributed under version 3 or later of the GNU GPL. * Build system fixes - distcheck now passes. * At least four security bug fixes: - CAN-2004-1184 - CAN-2004-1185 - CAN-2004-1186 - CVE-2008-3863, CVE-2008-4306 * Syntax highlighting fixes. - shell escaping rules from Shawn McMahon. - JavaScript regexps now recognised. - New highlighting rules for Fortran 90 from David Bowler. See changelogs for more detailed notes. @ text @$NetBSD: patch-ad,v 1.2 2009/02/13 18:53:28 abs Exp $ --- src/util.c.orig 2003-03-05 07:26:32.000000000 +0000 +++ src/util.c @@@@ -1239,6 +1239,8 @@@@ escape_string (char *string) /* Create result. */ cp = xmalloc (len + 1); + if (cp == NULL) + return NULL; for (i = 0, j = 0; string[i]; i++) switch (string[i]) { @@@@ -1879,6 +1881,7 @@@@ is_open (InputStream *is, FILE *fp, char char *cmd = NULL; int cmdlen; int i, pos; + char *cp; is->is_pipe = 1; @@@@ -1902,12 +1905,16 @@@@ is_open (InputStream *is, FILE *fp, char { case 's': /* Expand cmd-buffer. */ - cmdlen += strlen (fname); + if ((cp = shell_escape (fname)) != NULL) + { + cmdlen += strlen (cp); cmd = xrealloc (cmd, cmdlen); /* Paste filename. */ - strcpy (cmd + pos, fname); - pos += strlen (fname); + strcpy (cmd + pos, cp); + pos += strlen (cp); + free (cp); + } i++; break; @@@@ -2116,3 +2123,36 @@@@ buffer_len (Buffer *buffer) { return buffer->len; } + +/* + * Escapes the name of a file so that the shell groks it in 'single' + * quotation marks. The resulting pointer has to be free()ed when not + * longer used. +*/ +char * +shell_escape(const char *fn) +{ + size_t len = 0; + const char *inp; + char *retval, *outp; + + for(inp = fn; *inp; ++inp) + switch(*inp) + { + case '\'': len += 4; break; + default: len += 1; break; + } + + outp = retval = malloc(len + 1); + if(!outp) + return NULL; /* perhaps one should do better error handling here */ + for(inp = fn; *inp; ++inp) + switch(*inp) + { + case '\'': *outp++ = '\''; *outp++ = '\\'; *outp++ = '\'', *outp++ = '\''; break; + default: *outp++ = *inp; break; + } + *outp = 0; + + return retval; +} @ 1.2 log @Updated print/enscript to 1.6.4 pkgsrc changes: Add PKG_DESTDIR_SUPPORT, Set PAPERSIZE in BUILD_DEFS, pkglint Changes since 1.6.3: 2003-02-28 gettextize * Makefile.am (SUBDIRS): Add intl. * configure.in (AC_OUTPUT): Add intl/Makefile, 2003-02-28 gettextize * Makefile.am (SUBDIRS): Add m4. (ACLOCAL_AMFLAGS): New variable. (EXTRA_DIST): Add config.rpath. * configure.in (AC_OUTPUT): Add po/Makefile.in, (AM_GNU_GETTEXT_VERSION): Bump to 0.11.5. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.1 2005/03/17 12:24:13 salo Exp $ @ 1.1 log @Update to version 1.6.3nb1 nb1: ==== - security fixes for CAN-2004-1184, CAN-2004-1185, CAN-2004-1186 - patches from Debian/Gentoo - addresses PR pkg/29721 1.6.3: ====== - Changes in the highlighting / pretty printing - Support for state inheritance. - new highlighting rules - new output language `ansi' to print color outputs - new encodings - new options @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- src/util.c.orig 1999-09-17 17:26:51.000000000 +0200 +++ src/util.c 2005-03-17 11:58:59.000000000 +0100 @@@@ -1239,6 +1239,8 @@@@ d14 1 a14 1 @@@@ -1879,6 +1881,7 @@@@ d22 1 a22 1 @@@@ -1902,12 +1905,16 @@@@ d42 1 a42 1 @@@@ -2116,3 +2123,36 @@@@ @