diff options
author | Didier Raboud <odyx@debian.org> | 2011-01-27 15:45:50 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2011-01-27 15:45:50 +0100 |
commit | d1cf03383a481675a2458d6ffc95bca7f495eff8 (patch) | |
tree | 8031752b202ad5a1b26e6560361fc5a12be8b280 | |
parent | 1a03de334fd4e6aafb91b806ea35092a7774a8d7 (diff) |
Imported Upstream version 4.0.6
-rw-r--r-- | ChangeLog | 122 | ||||
-rw-r--r-- | INSTALL | 53 | ||||
-rw-r--r-- | Makefile.in | 123 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | USAGE | 12 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | VERSION.full | 2 | ||||
-rw-r--r-- | aclocal.m4 | 186 | ||||
-rw-r--r-- | config.h.in | 3 | ||||
-rwxr-xr-x | configure | 163 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rwxr-xr-x | depcomp | 93 | ||||
-rw-r--r-- | fileconverter.c | 4 | ||||
-rw-r--r-- | foomaticrip.c | 31 | ||||
-rw-r--r-- | foomaticrip.h | 2 | ||||
-rwxr-xr-x | missing | 61 | ||||
-rw-r--r-- | options.c | 142 | ||||
-rw-r--r-- | options.h | 6 | ||||
-rw-r--r-- | pdf.c | 20 | ||||
-rw-r--r-- | spooler.c | 4 | ||||
-rw-r--r-- | util.c | 42 | ||||
-rw-r--r-- | util.h | 7 |
22 files changed, 722 insertions, 362 deletions
@@ -1,3 +1,125 @@ +2010-12-15 Till Kamppeter <till.kamppeter@gmail.com> + + * Tagged branch for release 4.0.6. + + * VERSION, README, USAGE, configure.ac: Updated for release 4.0.6. + + * options.c: Allow length limitation for the substitution of the special + entities "&job;", "&user;", "&host;", "&title;", and "&options;": + The maximum length can be supplied via the PPD keywords + "*FoomaticRIP<Item>EntityMaxLength: <mexlength>" (for example + "*FoomaticRIPUserEntityMaxLength: 8") or by adding a number to the + individual entities (for example "&user8;"). If the string to + insert for the entity is longer than the limit, it gets cut off to + the limit. Feature requested by Uli Wehner from Ricoh + (http://forums.linux-foundation.org/read.php?30,13134). + +2010-12-10 Till Kamppeter <till.kamppeter@gmail.com> + + * foomaticrip.c: Make file type detection also work if the PostScript + or PDF input is preceeded by PJL with an additional '%' character. + Thanks to Alexpro for reporting this as Ubuntu bug #688551 and + supplying the patch. + +2010-11-11 Till Kamppeter <till.kamppeter@gmail.com> + + * util.c: The temp_dir() function did not take into account that + getenv() can return NULL. In such a case the fallback to /tmp + did not work. Thanks to Abel Abraham Camarillo Ojeda (spam at + verlet dot org) for the patch (bug #552). + + * fileconverter.c: Make the check for the text filter actually + work. Before, the text filter choice from the configuration file + was simply taken for good and not checked whether it is supported. + Thanks to Abel Abraham Camarillo Ojeda (spam at verlet dot org) + for the patch (bug #551). + +2010-08-27 Till Kamppeter <till.kamppeter@gmail.com> + + * options.c: Made sure that the unhtmlify() function does not write + the zero byte to mark the string end beyond the buffer. Also use a + much larger buffer for parsing "*FoomaticRIPOptionPrototype:" in + the PPD file (bug #515). + + * util.c: In strncpy_tochar() use the isempty() function to check + whether the input string is empty (bug #514). + +2010-08-10 Till Kamppeter <till.kamppeter@gmail.com> + + * Tagged branch for release 4.0.5. + + * VERSION, README, USAGE, configure.ac: Updated for release 4.0.5. + +2010-07-07 Till Kamppeter <till.kamppeter@gmail.com> + + * options.c: Make substitution of zeros by the the user-defined + page size in the prototype string for the custom page size + working. Before, only substitution of %0 and %1 worked reliably. + Thanks to Lutz Sammer (johns98 at web dot de) for reporting this + problem (see also bug 514, comment #1). + + * options.c: Make custom page size settings also work if the custom + size is set via embedded PostScript code and the comment to mark + the selected option setting is only "%% FoomaticRIPOptionSetting: + PageSize=Custom", without the size and unit parameters. Thanks to + Lutz Sammer for reporting this problem (see also bug 514, comment #1). + +2010-07-02 Till Kamppeter <till.kamppeter@gmail.com> + + * spooler.c: Config file for the default printer in spooler-less + (direct) printing mode was not read correctly. Thanks to Lutz + Sammer (johns98 at web dot de) for reporting this problem (see + also bug 514, comment #1). + + * spooler.c: Fixed error message output if a printer's PPD is missing + in spooler-less mode. There was a segfault due to the printer name + not specified in the _log() function call. Thanks to Lutz Sammer + for reporting this problem (see also bug 514, comment #1). + + * util.c: The isempty() function did not consider NULL as an empty + string. This caused segfaults when a string is considered non-empty + but in fact it is NULL. Thanks to Lutz Sammer for reporting this + problem (see also bug 514, comment #1). + + * util.c: strncpy_tochar() did not check whether the input string + is empty and returned a pointer one character beyond the input + string, leading to segfaults in the code calling this function. + Thanks to Lutz Sammer for reporting this problem (see also bug 514, + comment #1). + +2010-06-08 Till Kamppeter <till.kamppeter@gmail.com> + + * USAGE: Documentation correction. + +2010-06-07 Till Kamppeter <till.kamppeter@gmail.com> + + * USAGE: Finally completed the documentation update to reflect that + the Ghostscript library is not needed any more. + + * configure.ac, util.h, util.c: Added implementation of strcasestr() + function for non-GNU systems (completes fix of bug #303, thanks + to Tim Mooney for this fix). + + * foomaticrip.c, foomaticrip.h, pdf.c: Let foomatic-rip actually + error out if something goes wrong. It simply continued or closed + silently (exit status 0) on the following events: Failure of + print_file() function call, failure of Ghostscript to determine + the number of pages of a PDF input file (causes Ubuntu bug + #570522), failure to start Ghostscript to render a PDF file, + failure to create a temporary file for extracting selected pages + from a PDF file, failure to run Ghostscript to extract pages from + a PDF file, page count result being a negative number. + + * foomaticrip.c: Use EXIT_PRINTED constant and not hard-coded "0" + as exit value when terminating successfully. + + * foomaticrip.h: Correct definition of EXIT_STARVED constant. + +2010-03-26 Till Kamppeter <till.kamppeter@gmail.com> + + * options.c, options.h: Made some strings longer, to avoid space + problems. + 2010-02-15 Till Kamppeter <till.kamppeter@gmail.com> * Tagged branch for release 4.0.4. @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -10,7 +10,10 @@ unlimited permission to copy, distribute and modify it. Basic Installation ================== -These are generic installation instructions. +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -23,9 +26,9 @@ debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is +the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale -cache files.) +cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail @@ -35,20 +38,17 @@ some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. + `./configure' to configure the package for your system. - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. 2. Type `make' to compile the package. @@ -67,6 +67,9 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. + 6. Often, you can also type `make uninstall' to remove the installed + files again. + Compilers and Options ===================== @@ -78,7 +81,7 @@ details on some of the pertinent environment variables. by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. @@ -87,17 +90,15 @@ Compiling For Multiple Architectures You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the +own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. Installation Names ================== @@ -190,12 +191,12 @@ them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: +overridden in the site shell script). - /bin/bash ./configure CONFIG_SHELL=/bin/bash +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== diff --git a/Makefile.in b/Makefile.in index 1b8239c..f397041 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,13 +14,10 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -46,7 +43,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno + configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = beh foomatic-rip.1 @@ -59,7 +56,7 @@ am_foomatic_rip_OBJECTS = foomaticrip.$(OBJEXT) options.$(OBJEXT) \ fileconverter.$(OBJEXT) foomatic_rip_OBJECTS = $(am_foomatic_rip_OBJECTS) foomatic_rip_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -81,11 +78,8 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -INSTALL = @INSTALL@ A2PS = @A2PS@ ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -118,6 +112,7 @@ EXECPATH = @EXECPATH@ EXEEXT = @EXEEXT@ FILECONVERTER = @FILECONVERTER@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -128,6 +123,7 @@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ MPAGE = @MPAGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -150,12 +146,12 @@ SHELL = @SHELL@ STRIP = @STRIP@ TEXTTOPS = @TEXTTOPS@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -163,6 +159,7 @@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -188,8 +185,11 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ PREFIX = $(prefix) SRC = @srcdir@ BINDIR = $(bindir) @@ -263,7 +263,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @@ -282,7 +282,7 @@ foomatic-rip.1: $(top_builddir)/config.status $(srcdir)/foomatic-rip.1.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ @@ -305,7 +305,7 @@ clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) foomatic-rip$(EXEEXT): $(foomatic_rip_OBJECTS) $(foomatic_rip_DEPENDENCIES) @rm -f foomatic-rip$(EXEEXT) - $(LINK) $(foomatic_rip_LDFLAGS) $(foomatic_rip_OBJECTS) $(foomatic_rip_LDADD) $(LIBS) + $(LINK) $(foomatic_rip_OBJECTS) $(foomatic_rip_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -324,27 +324,26 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -356,8 +355,8 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -367,13 +366,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -388,24 +386,22 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/. - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -419,7 +415,7 @@ distdir: $(DISTFILES) -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz @@ -429,6 +425,10 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -455,6 +455,8 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -494,7 +496,7 @@ distcheck: dist $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -518,7 +520,7 @@ check: check-am all-am: Makefile $(PROGRAMS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install-exec: install-exec-am install-data: install-data-am @@ -559,10 +561,18 @@ info-am: install-data-am: +install-dvi: install-dvi-am + install-exec-am: install-binPROGRAMS +install-html: install-html-am + install-info: install-info-am +install-pdf: install-pdf-am + +install-ps: install-ps-am + installcheck-am: maintainer-clean-am: distclean-am maintainer-clean-generic @@ -579,21 +589,24 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-info-am +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ - dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-compile distclean-generic distclean-hdr \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-info-am + tags uninstall uninstall-am uninstall-binPROGRAMS # The install rule should check for kitloads and avoid stomping. It doesn't @@ -1,5 +1,5 @@ -Foomatic 4.0.4 +Foomatic 4.0.6 ============== @@ -1,5 +1,5 @@ -Foomatic 4.0.4 +Foomatic 4.0.6 ============== foomatic-filters @@ -74,9 +74,8 @@ Installation Foomatic runs on all systems where one can run the Perl interpreter and Ghostscript. -foomatic-filters needs the Ghostscript library for foomatic-rip and -the Perl interpreter for beh (Backend Error Handler) and the test -suite. +foomatic-filters needs the Perl interpreter for beh (Backend Error +Handler) and the test suite. To build foomatic-rip you need a C compiler and its standard libraries. @@ -138,9 +137,8 @@ package in some distributions): a normal user. The "configure" script will auto-detect where the programs have to be -installed and where the Perl interpreter and the Ghostscript library -are located. If "configure" fails because of something not being -installed, do +installed and where the Perl interpreter is located. If "configure" +fails because of something not being installed, do rm -rf config.cache autom*.cache @@ -1 +1 @@ -4.0.4 +4.0.6 diff --git a/VERSION.full b/VERSION.full index 664aeb2..e0049e4 100644 --- a/VERSION.full +++ b/VERSION.full @@ -1 +1 @@ -4.0.4.217 +4.0.6.230 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,7 +11,15 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,14 +29,31 @@ # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -85,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 7 +# serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -101,8 +126,10 @@ AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -116,15 +143,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 +# serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -152,6 +178,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) @@ -217,6 +244,7 @@ AC_CACHE_CHECK([dependency style of $depcc], depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -269,7 +297,8 @@ if test "x$enable_dependency_tracking" != xno; then AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -294,8 +323,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -342,14 +372,14 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 +# serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -366,16 +396,20 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl +[AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi fi # test whether we have cygpath @@ -395,6 +429,9 @@ m4_ifval([$2], AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl @@ -430,6 +467,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) @@ -443,16 +484,17 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -465,7 +507,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -543,14 +585,14 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -566,6 +608,7 @@ AC_SUBST($1)]) # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then @@ -576,7 +619,7 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -584,60 +627,23 @@ fi # AM_PROG_MKDIR_P # --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) +# Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) # Helper functions for option handling. -*- Autoconf -*- @@ -749,9 +755,21 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. diff --git a/config.h.in b/config.h.in index 80e8480..206d2af 100644 --- a/config.h.in +++ b/config.h.in @@ -53,6 +53,9 @@ /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP +/* Define to 1 if you have the `strcasestr' function. */ +#undef HAVE_STRCASESTR + /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for foomatic-rip "4.0.4". +# Generated by GNU Autoconf 2.61 for foomatic-rip "4.0.6". # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -572,8 +572,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='foomatic-rip' PACKAGE_TARNAME='foomatic-rip' -PACKAGE_VERSION='"4.0.4"' -PACKAGE_STRING='foomatic-rip "4.0.4"' +PACKAGE_VERSION='"4.0.6"' +PACKAGE_STRING='foomatic-rip "4.0.6"' PACKAGE_BUGREPORT='' ac_unique_file="options.c" @@ -653,6 +653,7 @@ target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA +am__isrc CYGPATH_W PACKAGE VERSION @@ -1231,7 +1232,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures foomatic-rip "4.0.4" to adapt to many kinds of systems. +\`configure' configures foomatic-rip "4.0.6" to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1297,7 +1298,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of foomatic-rip "4.0.4":";; + short | recursive ) echo "Configuration of foomatic-rip "4.0.6":";; esac cat <<\_ACEOF @@ -1393,7 +1394,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -foomatic-rip configure "4.0.4" +foomatic-rip configure "4.0.6" generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1407,7 +1408,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by foomatic-rip $as_me "4.0.4", which was +It was created by foomatic-rip $as_me "4.0.6", which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1760,7 +1761,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version="1.9" +am__api_version='1.10' + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -1943,38 +1945,53 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" else - mkdir_p='$(install_sh) -d' + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" fi fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac for ac_prog in gawk mawk nawk awk do @@ -2057,12 +2074,16 @@ else fi rmdir .tst 2>/dev/null -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } + fi fi # test whether we have cygpath @@ -2077,7 +2098,7 @@ fi # Define the identity of the package. PACKAGE='foomatic-rip' - VERSION='"4.0.4"' + VERSION='"4.0.6"' # Some tools Automake needs. @@ -2096,7 +2117,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right @@ -2200,7 +2221,7 @@ else fi fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -3195,9 +3216,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi - - -if test "x$enable_dependency_tracking" != xno; then + if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else @@ -3207,7 +3226,6 @@ fi - depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 @@ -3275,6 +3293,7 @@ else depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3304,9 +3323,7 @@ fi echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -3748,6 +3765,7 @@ else depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3777,9 +3795,7 @@ fi echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= @@ -6709,7 +6725,8 @@ done -for ac_func in dup2 getcwd gethostname regcomp setenv strcasecmp strchr strcspn strdup strncasecmp strndup strrchr strstr strtol + +for ac_func in dup2 getcwd gethostname regcomp setenv strcasecmp strchr strcspn strdup strncasecmp strndup strrchr strstr strcasestr strtol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -7833,7 +7850,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by foomatic-rip $as_me "4.0.4", which was +This file was extended by foomatic-rip $as_me "4.0.6", which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7886,7 +7903,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -foomatic-rip config.status "4.0.4" +foomatic-rip config.status "4.0.6" configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -7897,6 +7914,7 @@ gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8106,6 +8124,7 @@ target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim @@ -8162,7 +8181,6 @@ PPR!$PPR$ac_delim PPR_INTERFACES!$PPR_INTERFACES$ac_delim PPR_LIB!$PPR_LIB$ac_delim A2PS!$A2PS$ac_delim -ENSCRIPT!$ENSCRIPT$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -8204,6 +8222,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +ENSCRIPT!$ENSCRIPT$ac_delim MPAGE!$MPAGE$ac_delim TEXTTOPS!$TEXTTOPS$ac_delim FILECONVERTER!$FILECONVERTER$ac_delim @@ -8212,7 +8231,7 @@ EXECPATH!$EXECPATH$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -8439,6 +8458,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8492,6 +8516,7 @@ s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out @@ -8607,21 +8632,22 @@ echo "$as_me: $ac_file is unchanged" >&6;} fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. +_am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $ac_file | $ac_file:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| . 2>/dev/null || -echo X$ac_file | +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8656,8 +8682,9 @@ echo "$as_me: executing $ac_file commands" >&6;} # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ diff --git a/configure.ac b/configure.ac index 7617852..7e5ab5e 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(foomatic-rip, "4.0.4") +AC_INIT(foomatic-rip, "4.0.6") AM_INIT_AUTOMAKE([no-define]) AC_CONFIG_SRCDIR([options.c]) @@ -39,7 +39,7 @@ AC_FUNC_REALLOC AC_TYPE_SIGNAL AC_FUNC_STRTOD AC_FUNC_VPRINTF -AC_CHECK_FUNCS([dup2 getcwd gethostname regcomp setenv strcasecmp strchr strcspn strdup strncasecmp strndup strrchr strstr strtol]) +AC_CHECK_FUNCS([dup2 getcwd gethostname regcomp setenv strcasecmp strchr strcspn strdup strncasecmp strndup strrchr strstr strcasestr strtol]) ETCSEARCHPATH=${prefix}/etc:/usr/etc:/usr/local/etc @@ -1,9 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2005-07-09.11 +scriptversion=2007-03-29.01 -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software +# Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -91,7 +92,20 @@ gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" stat=$? if test $stat -eq 0; then : else @@ -201,34 +215,39 @@ aix) # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u "$@" -M fi stat=$? - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - if test $stat -eq 0; then : else - rm -f "$tmpdepfile" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done if test -f "$tmpdepfile"; then - outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -276,6 +295,46 @@ icc) rm -f "$tmpdepfile" ;; +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. @@ -288,13 +347,13 @@ tru64) if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to + # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and + # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is diff --git a/fileconverter.c b/fileconverter.c index 6751dbf..baee2a9 100644 --- a/fileconverter.c +++ b/fileconverter.c @@ -49,8 +49,10 @@ void set_fileconverter(const char *fc) { int i; for (i = 0; fileconverters[i][0]; i++) { - if (!strcmp(fc, fileconverters[i][0])) + if (!strcmp(fc, fileconverters[i][0])) { strlcpy(fileconverter, fileconverters[i][1], PATH_MAX); + break; + } } if (!fileconverters[i][0]) strlcpy(fileconverter, fc, PATH_MAX); diff --git a/foomaticrip.c b/foomaticrip.c index b548b1e..089e4ff 100644 --- a/foomaticrip.c +++ b/foomaticrip.c @@ -946,16 +946,22 @@ enum FileType { int guess_file_type(const char *begin, size_t len, int *startpos) { - const char * p; - - p = memchr(begin, '%', len); - if (!p) - return UNKNOWN_FILE; - *startpos = p - begin; - if (!memcmp(p, "%!", 2)) - return PS_FILE; - else if (!memcmp(p, "%PDF-1.", 7)) - return PDF_FILE; + const char * p, * end; + p = begin; + end = begin + len; + + while (p < end) + { + p = memchr(p, '%', end - p); + if (!p) + return UNKNOWN_FILE; + *startpos = p - begin; + if ((end - p) > 2 && !memcmp(p, "%!", 2)) + return PS_FILE; + else if ((end - p) > 7 && !memcmp(p, "%PDF-1.", 7)) + return PDF_FILE; + ++ p; + } *startpos = 0; return UNKNOWN_FILE; } @@ -1602,7 +1608,8 @@ int main(int argc, char** argv) PostScript file (all before the first page begins). */ optionset_copy_values(optionset("userval"), optionset("header")); - print_file(filename, 1); + if (!print_file(filename, 1)) + rip_die(EXIT_PRNERR_NORETRY, "Could not print file %s\n", filename); filename = strtok_r(NULL, " ", &p); } @@ -1639,6 +1646,6 @@ int main(int argc, char** argv) list_free(arglist); - return 0; + return EXIT_PRINTED; } diff --git a/foomaticrip.h b/foomaticrip.h index a13a465..37c05b1 100644 --- a/foomaticrip.h +++ b/foomaticrip.h @@ -56,7 +56,7 @@ #define EXIT_JOBERR 3 /* job is defective */ #define EXIT_SIGNAL 4 /* terminated after catching signal */ #define EXIT_ENGAGED 5 /* printer is otherwise engaged (connection refused) */ -#define EXIT_STARVED = 6; /* starved for system resources */ +#define EXIT_STARVED 6 /* starved for system resources */ #define EXIT_PRNERR_NORETRY_ACCESS_DENIED 7 /* bad password? bad port permissions? */ #define EXIT_PRNERR_NOT_RESPONDING 8 /* just doesn't answer at all (turned off?) */ #define EXIT_PRNERR_NORETRY_BAD_SETTINGS 9 /* interface settings are invalid */ @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2005-06-08.21 +scriptversion=2006-05-10.23 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. @@ -33,6 +33,8 @@ if test $# -eq 0; then fi run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. @@ -44,7 +46,7 @@ fi msg="missing on your system" -case "$1" in +case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -77,6 +79,7 @@ Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c @@ -106,7 +109,7 @@ esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). -case "$1" in +case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -135,7 +138,7 @@ esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case "$1" in +case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if test -z "$files" && files="config.h" touch_files= for f in $files; do - case "$f" in + case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg. You can get \`$1' as part of \`Autoconf' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else @@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if [ ! -f y.tab.h ]; then + if test ! -f y.tab.h; then echo >y.tab.h fi - if [ ! -f y.tab.c ]; then + if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if [ ! -f lex.yy.c ]; then + if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then touch $file else test -z "$file" || exec >$file @@ -289,11 +290,17 @@ WARNING: \`$1' is $msg. You should only need it if DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi @@ -317,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if fi firstarg="$1" if shift; then - case "$firstarg" in + case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case "$firstarg" in + case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 @@ -34,14 +34,19 @@ /* Values from foomatic keywords in the ppd file */ char printer_model [256]; -char printer_id [128]; +char printer_id [256]; char driver [128]; -char cmd [1024]; -char cmd_pdf [1024]; +char cmd [4096]; +char cmd_pdf [4096]; dstr_t *postpipe = NULL; /* command into which the output of this filter should be piped */ int ps_accounting = 1; char cupsfilter [256]; +int jobentitymaxlen = 0; +int userentitymaxlen = 0; +int hostentitymaxlen = 0; +int titleentitymaxlen = 0; +int optionsentitymaxlen = 0; /* JCL prefix to put before the JCL options (Can be modified by a "*JCLBegin:" keyword in the ppd file): */ @@ -677,7 +682,8 @@ char * get_valid_value_string(option_t *opt, const char *value) /* Check if "value" is a predefined choice (except for "Custom", which is * not really a predefined choice, but an error if used without further * parameters) */ - if (strcmp(value, "Custom") != 0 && (choice = option_find_choice(opt, value))) + if ((strcmp(value, "Custom") != 0 || strcmp(opt->name, "PageSize") == 0) && + (choice = option_find_choice(opt, value))) return strdup(choice->value); if (opt->type == TYPE_ENUM) { @@ -751,7 +757,7 @@ void build_foomatic_custom_command(dstr_t *cmd, option_t *opt, const char *value { choice_t *choice = option_find_choice(opt, "Custom"); char ** paramvalues = paramvalues_from_string(opt, values); - char width[30], height[20]; + char width[30], height[30]; int pos; assert(choice); @@ -765,7 +771,7 @@ void build_foomatic_custom_command(dstr_t *cmd, option_t *opt, const char *value if ((pos = dstrreplace(cmd, "%0", width, 0)) < 0) pos = dstrreplace(cmd, "0", width, 0); - if ((pos = dstrreplace(cmd, "%1", height, pos) < 0)) + if (dstrreplace(cmd, "%1", height, pos) < 0) dstrreplace(cmd, "0", height, pos); free_paramvalues(opt, paramvalues); @@ -1083,79 +1089,123 @@ static void unhtmlify(char *dest, size_t size, const char *src) { jobparams_t *job = get_current_job(); char *pdest = dest; - const char *psrc = src; + const char *psrc = src, *p = NULL; const char *repl; struct tm *t = localtime(&job->time); char tmpstr[10]; + size_t s, l, n; - while (*psrc && pdest - dest < size) { + while (*psrc && pdest - dest < size - 1) { if (*psrc == '&') { psrc++; repl = NULL; + p = NULL; + l = 0; /* Replace HTML/XML entities by the original characters */ - if (!prefixcmp(psrc, "apos;")) + if (!prefixcmp(psrc, "apos")) { repl = "\'"; - else if (!prefixcmp(psrc, "quot;")) + p = psrc + 4; + } else if (!prefixcmp(psrc, "quot")) { repl = "\""; - else if (!prefixcmp(psrc, "gt;")) + p = psrc + 4; + } else if (!prefixcmp(psrc, "gt")) { repl = ">"; - else if (!prefixcmp(psrc, "lt;")) + p = psrc + 2; + } else if (!prefixcmp(psrc, "lt")) { repl = "<"; - else if (!prefixcmp(psrc, "amp;")) + p = psrc + 2; + } else if (!prefixcmp(psrc, "amp")) { repl = "&"; + p = psrc + 3; /* Replace special entities by job->data */ - else if (!prefixcmp(psrc, "job;")) + } else if (!prefixcmp(psrc, "job")) { repl = job->id; - else if (!prefixcmp(psrc, "user;")) + p = psrc + 3; + if (jobentitymaxlen != 0) + l = jobentitymaxlen; + } else if (!prefixcmp(psrc, "user")) { repl = job->user; - else if (!prefixcmp(psrc, "host;")) + p = psrc + 4; + if (userentitymaxlen != 0) + l = userentitymaxlen; + } else if (!prefixcmp(psrc, "host")) { repl = job->host; - else if (!prefixcmp(psrc, "title;")) + p = psrc + 4; + if (hostentitymaxlen != 0) + l = hostentitymaxlen; + } else if (!prefixcmp(psrc, "title")) { repl = job->title; - else if (!prefixcmp(psrc, "copies;")) + p = psrc + 5; + if (titleentitymaxlen != 0) + l = titleentitymaxlen; + } else if (!prefixcmp(psrc, "copies")) { repl = job->copies; - else if (!prefixcmp(psrc, "rbinumcopies;")) { + p = psrc + 6; + } else if (!prefixcmp(psrc, "rbinumcopies")) { if (job->rbinumcopies > 0) { snprintf(tmpstr, 10, "%d", job->rbinumcopies); repl = tmpstr; } else repl = job->copies; + p = psrc + 12; } - else if (!prefixcmp(psrc, "options;")) + else if (!prefixcmp(psrc, "options")) { repl = job->optstr->data; - else if (!prefixcmp(psrc, "year;")) { + p = psrc + 7; + if (optionsentitymaxlen != 0) + l = optionsentitymaxlen; + } else if (!prefixcmp(psrc, "year")) { sprintf(tmpstr, "%04d", t->tm_year + 1900); repl = tmpstr; + p = psrc + 4; } - else if (!prefixcmp(psrc, "month;")) { + else if (!prefixcmp(psrc, "month")) { sprintf(tmpstr, "%02d", t->tm_mon + 1); repl = tmpstr; + p = psrc + 5; } - else if (!prefixcmp(psrc, "date;")) { + else if (!prefixcmp(psrc, "date")) { sprintf(tmpstr, "%02d", t->tm_mday); repl = tmpstr; + p = psrc + 4; } - else if (!prefixcmp(psrc, "hour;")) { + else if (!prefixcmp(psrc, "hour")) { sprintf(tmpstr, "%02d", t->tm_hour); repl = tmpstr; + p = psrc + 4; } - else if (!prefixcmp(psrc, "min;")) { + else if (!prefixcmp(psrc, "min")) { sprintf(tmpstr, "%02d", t->tm_min); repl = tmpstr; + p = psrc + 3; } - else if (!prefixcmp(psrc, "sec;")) { + else if (!prefixcmp(psrc, "sec")) { sprintf(tmpstr, "%02d", t->tm_sec); repl = tmpstr; + p = psrc + 3; } - + if (p) { + n = strtol(p, (char **)(&p), 0); + if (n != 0) + l = n; + if (*p != ';') + repl = NULL; + } else + repl = NULL; if (repl) { - strncpy(pdest, repl, size - (pdest - dest)); - pdest += strlen(repl); - psrc = strchr(psrc, ';') +1; + if ((l == 0) || (l > strlen(repl))) + l = strlen(repl); + s = size - (pdest - dest) - 1; + strncpy(pdest, repl, s); + if (s < l) + pdest += s; + else + pdest += l; + psrc = p + 1; } else { *pdest = '&'; @@ -1215,7 +1265,7 @@ void option_set_choice(option_t *opt, const char *name, const char *text, } if (!startswith(code, "%% FoomaticRIPOptionSetting")) - unhtmlify(choice->command, 1024, code); + unhtmlify(choice->command, 65536, code); } /* @@ -1529,10 +1579,10 @@ void read_ppd_file(const char *filename) unhtmlify(postpipe->data, postpipe->alloc, value->data); } else if (strcmp(key, "FoomaticRIPCommandLine") == 0) { - unhtmlify(cmd, 1024, value->data); + unhtmlify(cmd, 4096, value->data); } else if (strcmp(key, "FoomaticRIPCommandLinePDF") == 0) { - unhtmlify(cmd_pdf, 1024, value->data); + unhtmlify(cmd_pdf, 4096, value->data); } else if (strcmp(key, "FoomaticRIPNoPageAccounting") == 0) { /* Boolean value */ @@ -1600,8 +1650,8 @@ void read_ppd_file(const char *filename) /* "*FoomaticRIPOptionPrototype <option>: <code>" Used for numerical and string options only */ opt = assure_option(name); - opt->proto = malloc(128); - unhtmlify(opt->proto, 128, value->data); + opt->proto = malloc(65536); + unhtmlify(opt->proto, 65536, value->data); } else if (!strcmp(key, "FoomaticRIPOptionRange")) { /* *FoomaticRIPOptionRange <option>: <min> <max> @@ -1698,6 +1748,26 @@ void read_ppd_file(const char *filename) "longer supported by Foomatic >4.0. Exiting.\n"); exit(1); /* TODO exit more gracefully */ } + else if (!strcmp(key, "FoomaticRIPJobEntityMaxLength")) { + /* "*FoomaticRIPJobEntityMaxLength: <length>" */ + sscanf(value->data, "%d", &jobentitymaxlen); + } + else if (!strcmp(key, "FoomaticRIPUserEntityMaxLength")) { + /* "*FoomaticRIPUserEntityMaxLength: <length>" */ + sscanf(value->data, "%d", &userentitymaxlen); + } + else if (!strcmp(key, "FoomaticRIPHostEntityMaxLength")) { + /* "*FoomaticRIPHostEntityMaxLength: <length>" */ + sscanf(value->data, "%d", &hostentitymaxlen); + } + else if (!strcmp(key, "FoomaticRIPTitleEntityMaxLength")) { + /* "*FoomaticRIPTitleEntityMaxLength: <length>" */ + sscanf(value->data, "%d", &titleentitymaxlen); + } + else if (!strcmp(key, "FoomaticRIPOptionsEntityMaxLength")) { + /* "*FoomaticRIPOptionsEntityMaxLength: <length>" */ + sscanf(value->data, "%d", &optionsentitymaxlen); + } } fclose(fh); @@ -1742,7 +1812,7 @@ int ppd_supports_pdf() * line */ if (startswith(cmd, "gs")) { - strncpy(cmd_pdf, cmd, 1024); + strncpy(cmd_pdf, cmd, 4096); return 1; } @@ -55,7 +55,7 @@ typedef struct choice_s { char value [128]; char text [128]; - char command[1024]; + char command[65536]; struct choice_s *next; } choice_t; @@ -125,8 +125,8 @@ extern char jcltointerpreter[256]; extern char jclend[256]; extern char jclprefix[256]; -extern char cmd[1024]; -extern char cmd_pdf[1024]; +extern char cmd[4096]; +extern char cmd_pdf[4096]; extern int ps_accounting; @@ -52,10 +52,8 @@ static int pdf_count_pages(const char *filename) gspath, filename); FILE *pd = popen(gscommand, "r"); - if (!pd) { - _log("Failed to execute ghostscript to determine number of input pages!\n"); - return 0; - } + if (!pd) + rip_die(EXIT_STARVED, "Failed to execute ghostscript to determine number of input pages!\n"); fread(output, 1, 31, pd); pclose(pd); @@ -77,7 +75,7 @@ static int start_renderer(const char *cmd) _log("Starting renderer with command: %s\n", cmd); kid3 = start_process("kid3", exec_kid3, (void *)cmd, NULL, NULL); if (kid3 < 0) - return 0; + rip_die(EXIT_STARVED, "Could not start renderer\n"); return 1; } @@ -118,7 +116,7 @@ static int pdf_extract_pages(char filename[PATH_MAX], snprintf(filename, PATH_MAX, "%s/foomatic-XXXXXX", temp_dir()); mktemp(filename); if (!filename[0]) - return 0; + rip_die(EXIT_STARVED, "Unable to create temporary file!\n"); snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename); snprintf(first_arg, 50, "-dFirstPage=%d", first); @@ -132,10 +130,8 @@ static int pdf_extract_pages(char filename[PATH_MAX], gspath, filename_arg, first_arg, last_arg, pdffilename); FILE *pd = popen(gscommand, "r"); - if (!pd) { - _log("Could not run ghostscript to extract the pages!\n"); - return 0; - } + if (!pd) + rip_die(EXIT_STARVED, "Could not run ghostscript to extract the pages!\n"); pclose(pd); return 1; @@ -158,7 +154,7 @@ static int render_pages_with_generic_command(dstr_t *cmd, else { if (!pdf_extract_pages(tmpfile, filename, firstpage, lastpage)) - return 0; + rip_die(EXIT_STARVED, "Could not run ghostscript to extract the pages!\n"); dstrcatf(cmd, " < %s", tmpfile); } @@ -237,7 +233,7 @@ static int print_pdf_file(const char *filename) page_count = pdf_count_pages(filename); if (page_count <= 0) - return 0; + rip_die(EXIT_JOBERR, "Unable to determine number of pages, page count: %d\n", page_count); _log("File contains %d pages\n", page_count); optionset_copy_values(optionset("header"), optionset("currentpage")); @@ -410,7 +410,7 @@ int configfile_find_option(const char *configfile, const char *key, char *dest, if (!prefixcmp(line, "default")) { p = strchr(line, ':'); if (p) { - strncpy_omit(dest, p, destsize, omit_whitespace); + strncpy_omit(dest, p + 1, destsize, omit_whitespace_newline); if (dest[0]) break; } @@ -479,7 +479,7 @@ void init_direct_cps_pdq(list_t *arglist, dstr_t *filelist, jobparams_t *job) /* Search for the PPD file */ if (!find_ppdfile(user_default_path, job)) { - _log("There is no readable PPD file for the printer %s, is it configured?\n"); + _log("There is no readable PPD file for the printer %s, is it configured?\n", job->printer); exit(EXIT_PRNERR_NORETRY_BAD_SETTINGS); } } @@ -39,14 +39,15 @@ const char * temp_dir() if (!tmpdir) { - const char *dirs[] = { getenv("TMPDIR"), P_tmpdir, "/tmp", NULL }; - const char **dir; + const char *dirs[] = { getenv("TMPDIR"), P_tmpdir, "/tmp" }; + int i; - for (dir = dirs; *dir; dir++) - if (access(*dir, W_OK) == 0) { - tmpdir = *dir; + for (i = 0; i < (sizeof(dirs) / sizeof(dirs[0])); i++) { + if (access(dirs[i], W_OK) == 0) { + tmpdir = dirs[i]; break; } + } if (tmpdir) { _log("Storing temporary files in %s\n", tmpdir); @@ -110,7 +111,7 @@ void strlower(char *dest, size_t destlen, const char *src) int isempty(const char *string) { - return string && string[0] == '\0'; + return !string || string[0] == '\0'; } const char * strncpy_omit(char* dest, const char* src, size_t n, int (*omit_func)(int)) @@ -137,7 +138,32 @@ int omit_unprintables(int c) { return c>= '\x00' && c <= '\x1f'; } int omit_shellescapes(int c) { return strchr(shellescapes, c) != NULL; } int omit_specialchars(int c) { return omit_unprintables(c) || omit_shellescapes(c); } int omit_whitespace(int c) { return c == ' ' || c == '\t'; } +int omit_whitespace_newline(int c) { return omit_whitespace(c) || c == '\n'; } + +#ifndef HAVE_STRCASESTR +char * +strcasestr (const char *haystack, const char *needle) +{ + char *p, *startn = 0, *np = 0; + + for (p = haystack; *p; p++) { + if (np) { + if (toupper(*p) == toupper(*np)) { + if (!*++np) + return startn; + } else + np = 0; + } else if (toupper(*p) == toupper(*needle)) { + np = needle + 1; + startn = p; + } + } + return 0; +} +#endif + +#ifndef __OpenBSD__ size_t strlcpy(char *dest, const char *src, size_t size) { char *pdest = dest; @@ -177,6 +203,7 @@ size_t strlcat(char *dest, const char *src, size_t size) return len + (psrc - src); } +#endif /* ! __OpenBSD__ */ void strrepl(char *str, const char *chars, char repl) { @@ -248,6 +275,9 @@ const char * strncpy_tochar(char *dest, const char *src, size_t max, const char { const char *psrc = src; char *pdest = dest; + if (isempty(psrc)) { + return NULL; + } while (*psrc && --max > 0 && !strchr(stopchars, *psrc)) { *pdest = *psrc; pdest++; @@ -28,6 +28,7 @@ #define _GNU_SOURCE #endif +#include "config.h" #include <string.h> #include <stdio.h> @@ -57,6 +58,12 @@ int omit_unprintables(int c); int omit_shellescapes(int c); int omit_specialchars(int c); int omit_whitespace(int c); +int omit_whitespace_newline(int c); + +#ifndef HAVE_STRCASESTR +/* strcasestr() is not available under Solaris */ +char * strcasestr (const char *haystack, const char *needle); +#endif /* TODO check for platforms which already have strlcpy and strlcat */ |