2009-12-27 Tim Retout Apply patch * psgen.c: Use PATH_MAX 2009-12-27 Tim Retout Apply patch from Debian Security Team for CAN-2004-1184. * gsint.h: Add shell_escape prototype. * util.c (shell_escape): New function to escape filenames for shell usage. * util.c (is_open): Use shell_escape to expand command buffer. * main.c (main): Use single quotes when building command string, and use shell_escape to quote contents. * util.c (escape_string): Check return code of xmalloc. Apply patch from Werner Fink to address CVE-2008-3863, CVE-2008-4306. * psgen.c: Use PATH_MAX for various buffer sizes. Replace several strcpy calls with memset and strncpy. 2009-03-28 Tim Retout * psgen.c (recognize_eps_file): Remove ability to read EPS data from a pipe, as this executes arbitrary commands. It has been disabled in most distros for five years anyway. See CAN-2004-1185. * psgen.c (dump_ps_page_header): Use basename() and dirname() to split path. Fixes a buffer overflow - see CAN-2004-1186. 2009-01-25 Tim Retout * main.c (main): Respect $HOME when searching for ~/.enscriptrc 2008-01-01 Tim Retout * ChangeLog: Run M-x change-log-redate. Add copyright notice at end. * main.c (usage): Use PACKAGE_BUGREPORT instead of hardcoding the bug report address. * main.c (main) : Remove an unnecessary fclose of the toc temporary file, which was breaking the --toc option. 1999-09-17 Markku Rossi * main.c (handle_options): New option --footer to set the page footer string. (main): Modified the config file reading to be more user-tolerant. If the config file reading still fails, the enscript prints a verbose error message describing the situation. Enscript also suggest some workarounds for the problem. Hopefully this helps users to overcome their problems concerning the installation of the program. * psgen.c (dump_ps_page_header): Added support for user supplied footer strings. * main.c: Removed the obsolete --list-options option. 1999-09-13 Markku Rossi * main.c (handle_options): New option --extended-return-values to enable the extended return values. 1999-09-07 Markku Rossi * psgen.c (process_file): Added an argument `is_toc' to specify whether the file to process is a table of contents file. 1999-08-26 Markku Rossi * util.c (format_user_string): New escape `$p' for number of pages processed so far. 1999-07-16 Markku Rossi * Finished the static to dynamic memory buffer conversion. Now the enscript sources should not have any buffer overrun bugs. 1999-07-13 Markku Rossi * Converted many static buffers to dynamically allocated buffers. There are still more work in this area. 1999-07-09 Markku Rossi * main.c: Started to fix some possible buffer overflows. This needs still more work. * util.c: Implemented buffer_clear(). 1999-07-08 Markku Rossi * prt_lpr.c: Fixed to use the new memory buffer routines. * util.c: Implemented new dynamic memory buffer handling routines buffer_{{un,}init,alloc,free,append{,_len},ptr,len}(). 1999-07-05 Markku Rossi * main.c (handle_options): New option `--nup-columnwise' to layout pages in the N-up printing columnwise. (handle_options): New option `--swap-even-page-margins' to swap left and right side page marginals for even numbered pages. 1999-03-29 Markku Rossi * main.c (close_output_file): Check the return value of fclose on a written file, and warn if necessary. (John Bley, jbb6@acpub.duke.edu) 1999-03-12 Markku Rossi * main.c: Renamed all `pretty-print' options to the corresponding `highlight' ones. 1999-01-07 Markku Rossi * util.c (parse_font_spec): Cleaned up the font specification parsing. * main.c (main): Fixed the non-installation runs to preserve the PATH_SEPARATOR. (handle_options): New options -3, -4, -5, -6, -7, -8, -9 to select 3-9 columns. 1998-12-23 Markku Rossi * main.c (encodings): Added ISO-8859-{9,10} encodings. * psgen.c (process_file): Swapped the order in which the line numbers and line shading are printed. Now the line numbers won't be overwritten by the shading. 1998-12-07 Markku Rossi * main.c (main): Added a xgettext `no-c-format' string. 1998-10-29 Markku Rossi * main.c (main): Fixed the `--help-pretty-print' option to work with the new highlighting scheme. 1998-10-23 Markku Rossi * util.c (read_font_info): Added the `encoding' value to the font info cache key. * psgen.c (process_file): New special escape ^@bgcolor{} to set the text background color. * main.c: Changed enscript to use the new highlighting style. All states related options were changed. 1998-10-16 Markku Rossi * psgen.c: Added support for the user specified input encoding in the ^@font{} escapes. * util.c (parse_font_spec): Added support for the encoding specification in the font spec. All uses changed. * gsint.h: New the EncodingRegistry to hold the known input encodings. Made the encodings a global variable. 1998-09-07 Markku Rossi * main.c (main): Fixed to honor the HOME environment variable. 1998-06-25 Markku Rossi * main.c (handle_options): New option `--rotate-even-pages' to rotate each even-numbered page 180 degrees. (usage): Moved `--word-wrap' to correct position. 1998-06-24 Markku Rossi * psgen.c (dump_ps_page_header): Fixed N-up printing in the portrait mode. It used to work, but I have broke it sometime in the past. Now it is fixed again. * util.c (format_user_string): Fixed a bug from the `$n' formatting. We do not want to show the leading '/' in the result string. 1998-06-23 Markku Rossi * main.c (encodings): Fixed a typo where the ISO-8859-7 was called "creek" instead of "greek". * psgen.c (dump_ps_header): Fixed to obey the `pslevel' option; generate PostScript level 2 features only if the requested level is 2 or above. * main.c (handle_options): New option `--ps-level' to set the PS level that enscript should use. (main): Changed to pass the stdin to states as "-". * util.c (read_config): New config file option `PostScriptLevel' to set the PS level that enscript should use. 1998-06-22 Markku Rossi * psgen.c (dump_ps_page_header): Fixed a NULL-reference bug from the `--header' handling. 1998-06-17 Markku Rossi * main.c (usage): Added a missing `\n\' sequence in the usage text. 1998-06-11 Markku Rossi * main.c: Renamed ISO-8859-* encodings. 1998-05-26 Markku Rossi * util.c (format_user_string): Changed `$%' to format the page number as `2B' in the slicing mode. * main.c (main): Added double quotes around all file names in the pipe command strings. Now we can cooperate with file names with spaces. 1998-05-18 Markku Rossi * main.c (handle_options): Changed the way how the escape character code can be set. Now we accept decimals, octals, hexadecimals, and characters as-is. 1998-03-25 Markku Rossi * main.c: Added ISO-8859/7 (ISO latin7) encoding. 1998-03-09 Markku Rossi * main.c (handle_options): Option -C, --line-numbers takes now an optional argument that specifies the number of the first line of the input. 1998-02-23 Markku Rossi * psgen.c (process_file): Implemented horizontal columns. The option --h-column-height is used to set the column height and to activate the horizontal columns. 1998-01-14 Markku Rossi * psgen.c (get_next_token): Implemented word wrapping to be used instead of truncating `-c', `--truncate-lines' or character wrapping. Cleaned up statistics about truncated and wrapped lines. Now it obeys `--pages' and it works for both truncated and wrapped lines. 1998-01-13 Markku Rossi * util.c (is_ungetc): Implemented unlimited ungetc support to the InputStream interface. This is needed for the word wrap support. * main.c: New options --nup-xpad and --nup-ypad to change the page padding in N-up printing. (main): Cleaned up N-up printing. 1998-01-12 Markku Rossi * gsint.h: Replaced all stdarg functions with corresponding macros. Changed all calls of `error', `fatal', `cfg_fatal' and `message' to use the new macros. Now there should be no more errors on HP-SUX. 1998-01-02 Markku Rossi * main.c (main): Changed to lookup the enscript.st file from enscript_library instead of using the hard-coded `PREFIX/share' directory. Now it obeys the ENSCRIPT_LIBRARY environment variable. * psgen.c (dump_ps_header): Generate PageSize page device setting if it is requested. This should make the printer to select the correct paper tray automatically. * main.c (handle_options): Changed option -l, --lineprinter to set only --lines-per-page=66 and --no-header (removed --portrait and --columns=1). Now it conforms to Adobe's version. 1997-11-26 Markku Rossi * util.c (format_user_string): Fixed y2k bugs. 1997-09-30 Markku Rossi * main.c: Added ISO-8859/4 encoding, thanks to Ricardas Cepas . 1997-09-16 Markku Rossi * main.c (version): Updated to conform the latest GNU coding standard. 1997-08-28 Markku Rossi * main.c: New option `--margins=LEFT:RIGHT:TOP:BOTTOM' to adjust page marginals. 1997-08-11 Markku Rossi * psgen.c (divert): Changed to use tempnam() instead of tmpnam(). (get_next_token): Fixed tabulator character handling with variable width fonts. Now it really works; the left margins is really pretty. 1997-07-03 Markku Rossi * psgen.c (read_special_escape): Implemented new `escape' special escape to change the escape character. 1997-06-10 Markku Rossi * psgen.c: Optimized the size of the generated PostScript output. (print_line_number): Fixed to print the line number with the default body font, not with the currently active font which might have been selected with font escapes. (process_file): New special escape ^@bggray{} to set the text background color. 1997-06-06 Markku Rossi * psgen.c: Fixed lineskip to work better when changing the font at the beginning of the line. 1997-06-05 Markku Rossi * psgen.c (dump_empty_page): Fixed --file-align option to work even if we cross the page boundary in N-up mode. 1997-05-28 Markku Rossi * main.c: New option --mark-wrapped-lines[=STYLE], MarkWrappedLines to mark wrapped lines in the printout. 1997-05-22 Markku Rossi * main.c (main): Coded more information to the return value. 1997-03-19 Markku Rossi * main.c: New option -W, --language to specify the output language. New option --color to change the States color model from the command line. Made option -J to be an alias for -t, --title. Make option -# to be an alias for -n, --copies. 1997-03-04 Markku Rossi * util.c (read_config): New config file option `StatesPath' to specify the path for the states program. * psgen.c: Fixed --file-align option which was broken with the --nup option. 1997-03-03 Markku Rossi * psgen.c (dump_ps_page_header): Implemented user escapes for user defined header strings. 1997-02-26 Markku Rossi * Release enscript-1.5.0. 1997-02-21 Markku Rossi * util.c (read_font_info): Optimized AFM caching, this speeds up enscript when using ^@font{} escapes a lot (-E). (read_font_info): New input encoding asciidkno. Renamed asciiscands to asciifise. 1997-02-18 Markku Rossi * main.c: New option -U NUM, --nup=NUM to specify how many logical output pages are printed on each physical output page. 1997-02-06 Markku Rossi * util.c (parse_font_spec): Added a warning about negative font sizes. 1997-02-03 Markku Rossi * main.c: New option `--help-pretty-print' to describe all supported --pretty-print languages and file formats. 1997-01-24 Markku Rossi * main.c (main): Changed the output file creation to be demand-driven. If the input file (all input files) could not be opened, enscript doesn't generate any output. This is a good thing. 1997-01-23 Markku Rossi * gsint.h: Changed the way how memmove() and memcpy() are defined handled. Not replacements can be found form compat lib so we do not need any #define kludges. 1997-01-21 Markku Rossi * Makefile.am: Removed testcase.sh and moved all tests to ../tests directory. * util.c (read_config): Added states dependant config file options: `StatesColorModel', `StatesConfigFile' and `StatesHighlightLevel'. 1997-01-13 Markku Rossi * mkafmmap.c: Internationalized mkafmmap program. * util.c (read_config): New option `OutputFirstLine' to set the PostScript output's first line. 1996-11-28 Markku Rossi * main.c: New option `--E', `--pretty-print' to pretty print source codes with `states'. * psgen.c: New special escape ^@color{r g b}. * util.c (format_user_string): Fixed bug from the `$n' escape formatting. (read_config): New option `NoJobHeaderSwitch' to specify the spooler option to suppress the job header. 1996-11-05 Markku Rossi * psgen.c: fixed line number spacing bug which occured when using line numbers with escapes. * main.c: Added ISO-8859/5 (ISO latin5) encoding. 1996-09-07 Markku Rossi * main.c: Added Adobe's Standard cyrillic Font KOI8 encoding. 1996-08-30 Markku Rossi * util.c (parse_font_spec): Accept font point size in width/height format. 1996-08-23 Markku Rossi * util.c (read_config): New config file option TOCFormat. * psgen.c (process_file): Implemented user-definable format strings for TOC entries. * main.c: New option --slice to print vertical slices of input files. 1996-08-05 Markku Rossi * main.c: New option --file-align=ALIGN to align separate input files to even ALIGN page count. 1996-07-24 Markku Rossi * main.c: New option --toc to print the Table of Contents. 1996-07-17 Markku Rossi * Release enscript-1.4.0. 1996-06-16 Markku Rossi * psgen.c (get_next_token): Fixed line number counting for truncated lines. (paste_epsf): Fixed a bug which printed EPS images to pages which didn't belong to any of the requested page ranges. * main.c (main): Added new configuration file: SYSCONFDIR/enscriptsite.cfg. This is intended for the site-specific configuration whereas the global configuration file SYSCONFDIR/enscript.cfg is for the global defaults. Site-configuration file is never overwritten by installing a new version of enscript so it is a safe place to store site-specific media etc. definitions. 1996-06-13 Markku Rossi * main.c (handle_options): New option `--printer-options' to pass extra options to the printer command. * psgen.c (process_file): Count shade-box's position from the font's FontBBox value. (process_file): New escape `ps' to add raw PostScript code to the output. * main.c: New option --filter=STR, -I STR which sets the input filter for source files. 1996-05-24 Markku Rossi * util.c (read_config): New config file option `FormFeedType' to specify what to do when a formfeed character is encountered from input. * psgen.c (read_special_escape): Cleaned up special escapes parsing. (read_special_escape): New escapes: `newpage', `setfilename' and `setpagenumber'. * util.c (read_config): New config option `AcceptCompositeCharacters' to specify whatever we accept PostScript font's composite characters or should we consider them as non-existent. (download_font): Added support for binary-coded .pfb fonts, thanks to Bruce Albrecht . * main.c (long_options): Renamed option --pass-through-ps-files to --pass-through. 1996-05-22 Markku Rossi * psgen.c (process_file): Fixed carriage return character handling. 1996-05-10 Markku Rossi * psgen.c (read_special_escape): New special escape `shade' to highlight regions of text. * main.c (usage): Cleaned up --help messages. 1996-05-09 Markku Rossi * util.c (read_config): New configuration file option: EscapeChar. 1996-05-07 Markku Rossi * util.c (read_config): New config file option `UnderlayStyle' to specify the underlay printing style. * main.c: New option: -j, --borders to print borders around columns. (long_options): New option --ul-style to specify the underlay printing style. 1996-05-02 Markku Rossi * util.c (read_font_info): Added AFM cache to speedup font-escape processing. * psgen.c (print_line_number): Don't print line numbers for wrapped lines. 1996-04-22 Markku Rossi * util.c (format_user_string): New directive `%H' for the document title. * main.c: Changed option -e, --escapes to take an optional argument which specifies the escape character. 1996-04-01 Markku Rossi * psgen.c (process_file): Now ^@font{} escapes work over page boundaries. 1996-03-27 Markku Rossi * main.c (main): New option -a, --pages to select which pages are printed. 1996-03-26 Markku Rossi * util.c (format_user_string): New option: `$=' number of pages in the current input file. * psgen.c (process_file): Added diversions to count the total pages within a file (%Format: $=). 1996-03-12 Markku Rossi * main.c (handle_options): Changed option -l, --lineprinter to print 66 lines per page instead of 65 lines. * util.c (read_config): New config file option: PagePrefeed. * main.c (main): New options: -k, --page-prefeed, -K, --no-page-prefeed. 1996-03-07 Markku Rossi * util.c (format_user_string): New escape: $(ENVVAR). 1996-03-05 Markku Rossi * util.c (read_config): New config file options: HighlightBars and HighLightBarGray. * main.c: New option: -H, --highlight-bars and --highlight-bar-gray to control the highlight bar printing. 1996-03-01 Markku Rossi * main.c: New option: -h, --no-job-header to suppress the job header page. (main): Changed option --title to set the name of stdin. 1996-02-29 Markku Rossi * Added support for the automatic de-ANSI-fication. * Renamed package to enscript. 1996-02-25 Markku Rossi * main.c (main): changed stdin's name to be an empty string instead of "(stdin)". This is how Adobe's enscript does it. 1996-02-23 Markku Rossi * main.c (main): Added environment variable GENSCRIPT_LIBRARY which can be used to overwrite the build-in library path. * psgen.c (read_special_escape): fixed a bug which caused pipes to the EPS files to be closed with fclose(). 1996-02-21 Markku Rossi * Makefile.in (exec_prefix): fixed to honor the value given by the configure script. 1996-02-20 Markku Rossi * Added hp8 (HP Roman-8) encoding. 1996-02-19 Markku Rossi * Release genscript-1.3.0. * main.c (main): New config file option `AppendCtrlD' which can be used to append the ^D character to the end of the output. * psgen.c (do_pass_through_ps_file): added pass-through for the PCL files. 1996-02-08 Markku Rossi * util.c (read_config): New config file option `Clean7Bit' to specify how characters greater than 127 are handled. 1996-02-07 Markku Rossi * gsint.h: Implemented unit selection for the `--indent' option. 1996-01-30 Markku Rossi * main.c (main): Now genscript can be used even if it is not installed. * Makefile.in (check): new target 1996-01-25 Markku Rossi * util.c (paste_file): Implemented `%HeaderHeight' and `%FooterHeight' directives. 1996-01-09 Markku Rossi * Finished Win-95/NT port. 1996-01-08 Markku Rossi * First Win-95/NT port with MSC 2.00. * util.c (format_user_string): New options: %N and $%. 1996-01-05 Markku Rossi * psgen.c (dump_ps_header): Removed date and time ps-constants which can now be formatted with the `%Format' directive: - usadatestr = %W - eurdatestr = %E - findatestr = %F - timestr = %C (dump_ps_page_header): Removed fmodstr ps-constant which can now be formatted with the `%Format' directive: - fmodstr = $D{%a %b %e %T %Y} * util.c (format_user_string): Implemented `%Format' directive which can be used to format user defined strings in fancy headers. 1996-01-04 Markku Rossi * main.c: Added pslatin1 encoding (PostScript interpreter's ISOLatin1Encoding). 1996-01-03 Markku Rossi * Created a new Makefile to the compat subdirectory; now genscript does not need a make with the VPATH feature. * main.c (usage): Split usage string to smaller parts wich are printed separately. 1996-01-02 Markku Rossi * main.c: New option: --non-printable-format, NonPrintableFormat. 1995-12-20 Markku Rossi * Added statistics about non-printable character codes. * main.c: New option: -z, --no-formfeed to disable form feed character interpretation. * util.c (do_list_missing_characters): Changed output to go to stderr instead of stdout. 1995-12-19 Markku Rossi * util.c (read_config): New config file options: UnderlayAngle and UnderlayPosition. * main.c (main): New options: --ul-angle and --ul-position. 1995-12-18 Markku Rossi * configure.in (PATH_SEPARATOR): Defined a new constant PATH_SEPARATOR to specify the character which separates path components. Fixed also all uses. * prt_lpr.c: Isolated printer related stuffs to a separate C file to help micro ports. * Makefile.in: Removed pre-defined eps images from the distribution. * util.c (parse_font_spec): Added support for the new `name@ptsize' font specification. 1995-11-28 Markku Rossi * main.c (handle_options): Option -u, --underlay was changed to take an optional argument. If no argument is given, underlay is not printed. * util.c (read_config): New config file option `Underlay' to specify the underlay text. * Makefile.in: Fixed Makefile to obey the GNU Coding Standards. Changed datadir from `prefix/lib' to `prefix/share'. 1995-11-27 Markku Rossi * util.c (read_config): New config file options: UnderlayFont and UnderlayGray * main.c: Renamed long options: --output-file => --output --queue => --printer --tab-size => --tabsize (long_options): made --silent to be an alias for --quiet * utils.c: Renamed config file option `Queue' to `Printer'. 1995-11-08 Markku Rossi * Added latin3 encoding (from the latin3.txt file by Duncan C Thomson). 1995-11-02 Markku Rossi * psgen.c: Fixed a bug which added document headers and trailers to pass-through PostScript files. 1995-10-31 Markku Rossi * Release genscript-1.2.20. 1995-10-27 Markku Rossi * Added option -C, --line-numbers. 1995-10-26 Markku Rossi * Added option -Z, --pass-through-ps-files. 1995-10-24 Markku Rossi * Cleaned up some HTML entity codes in encoding tables. 1995-10-18 Markku Rossi * Added latin2 encoding. 1995-10-10 Markku Rossi * main.c (main): changed fancy header's height from 40 to 36 points. 1995-10-05 Markku Rossi * New config file options: Queue and QueueParam. * genscript.man: minor cleanups. 1995-10-02 Markku Rossi * Release genscript-1.2.1. 1995-09-29 Markku Rossi * main.c: read default options from the GENSCRIPT (and ENSCRIPT) environment variable 1995-09-26 Markku Rossi * font size and baselineskip can be given as a decimal number * psgen.c: Fixed DSC comments, now generated output is DSC 3.0 conforming. 1995-09-21 Markku Rossi * Implemented .pf{a,b} file downloading. 1995-09-20 Markku Rossi * psgen.c (read_special_escape): new option 's' (scale) to specify an explicit scale for an eps image. * psgen.c: fixed epsf escape to start a new column if the specified image does not fit to the current one. 1995-09-18 Markku Rossi * main.c: Fixed some typos. * Added backspace handling. 1995-09-09 Markku Rossi * main.c (main): fixed typos that broke -o and -X options. 1995-09-04 Markku Rossi * Release genscript-1.1.4. * Added option --page-label-format. * psgen.c (dump_ps_header): Added findatestr. (paste_epsf): Fixed paste_epsf()'s EPS file recognization. 1995-08-30 Markku Rossi * Added options -u, --underlay, --ul-gray and --ul-font. * psgen.c (read_float): now dimensions can be specified in different units. 1995-08-29 Markku Rossi * Changed PostScript font's default encoding name from 'default' to 'ps'. * New config file option: DefaultOutputMethod. * Added option --indent, -i. * Cleaned up options in manual page, help and code. * Replaced StringSet module with StringHash. * psgen.c (paste_epsf): Now EPS images can be read from command's standard output. 1995-08-24 Markku Rossi * vms.txt: Added VMS multinational input encoding. * mac.txt: Cleaned up character table. * Added options -S, --statusdict and -D, --setpagedevice. 1995-08-23 Markku Rossi * Improved configure to handle more non-ANSI features. * Fixed a declaration bug from compat/strerror.c. * psgen.c (read_float): replaced strtod() with atof(). * xalloc.c (xrealloc): do an explicit malloc() if old pointer is NULL. * ibmpc.txt: Cleaned up character table. * psgen.c (get_next_token): control characters are now printed in the escaped form. 1995-08-21 Markku Rossi * Release genscript-1.0.1. 1995-08-17 Markku Rossi * Minor cleanups. 1995-08-15 Markku Rossi * Added option --baseline. * Fixed epsf escape's options. 1995-08-14 Markku Rossi * Added support for AFM files. 1995-08-09 Markku Rossi * Added option --newline to select the newline character. * Cleaned up character set tables. 1995-08-07 Markku Rossi * Added Mac input encoding. 1995-08-03 Markku Rossi * New special escapes: 'font' and 'comment'. * New option --tab-size=NUM, -T NUM to define tab expansion size. * General code and document cleanups. 1995-07-31 Markku Rossi * Added support for --copies option. Now it really works. * util.c (paste_file): parses '%%DocumentNeededResources:' comments * Added options --font and --header-font. 1995-07-27 Markku Rossi * psgen.c (paste_epsf): now eps files are also looked up from libpath. (read_special_escape): epsf: added option 'r'. 1995-07-26 Markku Rossi * psgen.c: added support for inlined EPS-files. 1995-07-25 Markku Rossi * Added IBM PC input encoding. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2008 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.