FreeBSD Bugzilla – Attachment 161371 Details for
Bug 203326
[PATCH] print/a2ps: command "a2ps -M a4 --list=defaults" dumps a2ps.core
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for print/a2ps
patch-a2ps.diff (text/plain), 21.44 KB, created by
Tatsuki Makino
on 2015-09-25 09:09:36 UTC
(
hide
)
Description:
patch for print/a2ps
Filename:
MIME Type:
Creator:
Tatsuki Makino
Created:
2015-09-25 09:09:36 UTC
Size:
21.44 KB
patch
obsolete
>Index: files/patch-contrib-emacs-Makefile.in >=================================================================== >--- files/patch-contrib-emacs-Makefile.in (revision 386312) >+++ files/patch-contrib-emacs-Makefile.in (working copy) >@@ -1,7 +1,6 @@ >-Index: contrib/emacs/Makefile.in >---- contrib/emacs/Makefile.in.orig 2011-09-27 15:17:26.000000000 +0900 >-+++ contrib/emacs/Makefile.in 2011-09-27 15:18:10.000000000 +0900 >-@@ -159,8 +159,9 @@ >+--- contrib/emacs/Makefile.in.orig 2000-02-24 18:01:08 UTC >++++ contrib/emacs/Makefile.in >+@@ -159,8 +159,9 @@ Makefile: $(srcdir)/Makefile.in $(top_b > > install-dist_lispLISP: $(dist_lisp_LISP) $(ELCFILES) > @$(NORMAL_INSTALL) >@@ -13,7 +12,7 @@ > if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ > f="`echo $$p | sed -e 's|^.*/||'`"; \ > echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(lispdir)/$$f"; \ >-@@ -169,7 +170,8 @@ >+@@ -169,7 +170,8 @@ install-dist_lispLISP: $(dist_lisp_LISP) > echo " $(INSTALL_DATA) $${p}c $(DESTDIR)$(lispdir)/$${f}c"; \ > $(INSTALL_DATA) $${p}c $(DESTDIR)$(lispdir)/$${f}c; \ > else : ; fi; \ >Index: files/patch-contrib-tmpdircreation >=================================================================== >--- files/patch-contrib-tmpdircreation (revision 386312) >+++ files/patch-contrib-tmpdircreation (working copy) >@@ -1,116 +0,0 @@ >-diff -ru contrib.orig/card.in contrib/card.in >---- contrib.orig/card.in Thu Dec 30 19:23:25 2004 >-+++ contrib/card.in Thu Dec 30 19:29:49 2004 >-@@ -38,7 +38,7 @@ >- LC_ALL="${LC_ALL-C}" export LC_ALL >- print_form_feeds=: >- RM="/bin/rm -rf" >--tmp_dir=${TMPDIR-/tmp}/$program.$$ >-+tmp_dir=$(mktemp -d -t ${program}) || exit 1 >- tmp_file=$tmp_dir/card >- success=false >- verbose=: >-@@ -190,7 +190,6 @@ >- >- # Create a tmp dir and be ready to clean up >- trap "$RM $tmp_dir" 0 1 2 15 >--(umask 077 && mkdir $tmp_dir) || exit 1 >- >- case $LC_ALL in >- fr) footer="Engendré par $version_short" ;; >-diff -ru contrib.orig/fixps.in contrib/fixps.in >---- contrib.orig/fixps.in Thu Dec 30 19:23:25 2004 >-+++ contrib/fixps.in Thu Dec 30 19:31:22 2004 >-@@ -38,7 +38,7 @@ >- run_gs=0 >- # What action to perform: fixps, cat, check, and gs >- task=fixps >--tmpdir=/tmp/$program.$$ >-+tmpdir=$(mktemp -d -t ${program}) || exit 1 >- verbose=echo >- >- # The version/usage strings >-@@ -191,7 +191,6 @@ >- trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15 >- fi >- >--mkdir $tmpdir >- fixps_sed=$tmpdir/fixps.sed >- >- # If printing from stdin, save into a tmp file >-diff -ru contrib.orig/pdiff.in contrib/pdiff.in >---- contrib.orig/pdiff.in Thu Dec 30 19:23:25 2004 >-+++ contrib/pdiff.in Thu Dec 30 19:16:59 2004 >-@@ -34,7 +34,7 @@ >- diff_options='-u' >- file= >- output= >--tmpdir=/tmp/$program.$$ >-+tmpdir=$(mktemp -d -t ${program}) || exit 1 >- verbose=echo >- wdiff_prog=${WDIFF:-wdiff} >- wdiff_options='-w[wd- -x-wd] -y{wd+ -z+wd}' >-diff -ru contrib.orig/psmandup.in contrib/psmandup.in >---- contrib.orig/psmandup.in Thu Dec 30 19:23:25 2004 >-+++ contrib/psmandup.in Thu Dec 30 19:32:30 2004 >-@@ -36,7 +36,7 @@ >- message= >- psselect=${PSSELECT:-psselect} >- psset=${PSSET:-psset} >--tmpdir=/tmp/$program.$$ >-+tmpdir=$(mktemp -d -t ${program}) || exit 1 >- >- # These two must be kept in synch. They are opposed. >- verbose=echo >-@@ -184,8 +184,6 @@ >- # Temp dir. Get ready not to leave junk (if not debugging) >- trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15 >- fi >-- >--mkdir $tmpdir >- >- # If printing from stdin, save into a tmp file >- if test $file = '-'; then >-diff -ru contrib.orig/psset.in contrib/psset.in >---- contrib.orig/psset.in Thu Dec 30 19:23:25 2004 >-+++ contrib/psset.in Thu Dec 30 19:33:50 2004 >-@@ -33,7 +33,7 @@ >- output=- >- pagedevices= # `;' separated list of `key:value' >- quiet=: # i.e., verbose >--tmpdir=${TMPDIR:-/tmp}/$program.$$ >-+tmpdir=$(mktemp -d -t ${program}) || exit 1 >- sedscript=$tmpdir/psset.sed >- >- # The version/usage strings >-@@ -185,8 +185,6 @@ >- echo "$help" 1>&2 >- exit 1;; >- esac >-- >--mkdir $tmpdir >- >- if test -n "$debug"; then >- # Set -x now if debugging >-diff -ru contrib.orig/texi2dvi4a2ps contrib/texi2dvi4a2ps >---- contrib.orig/texi2dvi4a2ps Thu Dec 30 19:23:25 2004 >-+++ contrib/texi2dvi4a2ps Thu Dec 30 19:34:36 2004 >-@@ -91,7 +91,7 @@ >- quiet= # by default let the tools' message be displayed >- set_language= >- textra= >--tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems. >-+tmpdir=$(mktemp -d -t ${program}) || exit 1 >- txincludes= # TEXINPUTS extensions >- txiprereq=19990129 # minimum texinfo.tex version to have macro expansion >- verbose=false # echo for verbose mode >-@@ -202,9 +202,6 @@ >- if test -z "$debug"; then >- trap "cd / && rm -rf $tmpdir" 0 1 2 15 >- fi >-- >--# Create the temporary directory with strict rights >--(umask 077 && mkdir $tmpdir) || exit 1 >- >- # Prepare the tools we might need. This may be extra work in some >- # cases, but improves the readibility of the script. >Index: files/patch-contrib_card.in >=================================================================== >--- files/patch-contrib_card.in (revision 0) >+++ files/patch-contrib_card.in (working copy) >@@ -0,0 +1,19 @@ >+--- contrib/card.in.orig 2000-01-27 00:42:36 UTC >++++ contrib/card.in >+@@ -38,7 +38,7 @@ help="Try \`$program --help' for more in >+ LC_ALL="${LC_ALL-C}" export LC_ALL >+ print_form_feeds=: >+ RM="/bin/rm -rf" >+-tmp_dir=${TMPDIR-/tmp}/$program.$$ >++tmp_dir=$(mktemp -d -t ${program}) || exit 1 >+ tmp_file=$tmp_dir/card >+ success=false >+ verbose=: >+@@ -190,7 +190,6 @@ fi >+ >+ # Create a tmp dir and be ready to clean up >+ trap "$RM $tmp_dir" 0 1 2 15 >+-(umask 077 && mkdir $tmp_dir) || exit 1 >+ >+ case $LC_ALL in >+ fr) footer="Engendré par $version_short" ;; >Index: files/patch-contrib_fixps.in >=================================================================== >--- files/patch-contrib_fixps.in (revision 0) >+++ files/patch-contrib_fixps.in (working copy) >@@ -0,0 +1,19 @@ >+--- contrib/fixps.in.orig 2000-02-21 08:16:15 UTC >++++ contrib/fixps.in >+@@ -38,7 +38,7 @@ output=- # Default is stdout >+ run_gs=0 >+ # What action to perform: fixps, cat, check, and gs >+ task=fixps >+-tmpdir=/tmp/$program.$$ >++tmpdir=$(mktemp -d -t ${program}) || exit 1 >+ verbose=echo >+ >+ # The version/usage strings >+@@ -191,7 +191,6 @@ else >+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15 >+ fi >+ >+-mkdir $tmpdir >+ fixps_sed=$tmpdir/fixps.sed >+ >+ # If printing from stdin, save into a tmp file >Index: files/patch-contrib_pdiff.in >=================================================================== >--- files/patch-contrib_pdiff.in (revision 0) >+++ files/patch-contrib_pdiff.in (working copy) >@@ -0,0 +1,11 @@ >+--- contrib/pdiff.in.orig 1999-10-24 15:07:51 UTC >++++ contrib/pdiff.in >+@@ -34,7 +34,7 @@ diff_prog=${DIFF:-diff} >+ diff_options='-u' >+ file= >+ output= >+-tmpdir=/tmp/$program.$$ >++tmpdir=$(mktemp -d -t ${program}) || exit 1 >+ verbose=echo >+ wdiff_prog=${WDIFF:-wdiff} >+ wdiff_options='-w[wd- -x-wd] -y{wd+ -z+wd}' >Index: files/patch-contrib_psmandup.in >=================================================================== >--- files/patch-contrib_psmandup.in (revision 0) >+++ files/patch-contrib_psmandup.in (working copy) >@@ -0,0 +1,20 @@ >+--- contrib/psmandup.in.orig 1999-10-24 13:06:42 UTC >++++ contrib/psmandup.in >+@@ -36,7 +36,7 @@ fixps=${FIXPS:-fixps} >+ message= >+ psselect=${PSSELECT:-psselect} >+ psset=${PSSET:-psset} >+-tmpdir=/tmp/$program.$$ >++tmpdir=$(mktemp -d -t ${program}) || exit 1 >+ >+ # These two must be kept in synch. They are opposed. >+ verbose=echo >+@@ -185,8 +185,6 @@ else >+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15 >+ fi >+ >+-mkdir $tmpdir >+- >+ # If printing from stdin, save into a tmp file >+ if test $file = '-'; then >+ file=$tmpdir/stdin.ps >Index: files/patch-contrib_psset.in >=================================================================== >--- files/patch-contrib_psset.in (revision 0) >+++ files/patch-contrib_psset.in (working copy) >@@ -0,0 +1,20 @@ >+--- contrib/psset.in.orig 1999-10-24 12:41:46 UTC >++++ contrib/psset.in >+@@ -33,7 +33,7 @@ fixps=${FIXPS:-fixps} >+ output=- >+ pagedevices= # `;' separated list of `key:value' >+ quiet=: # i.e., verbose >+-tmpdir=${TMPDIR:-/tmp}/$program.$$ >++tmpdir=$(mktemp -d -t ${program}) || exit 1 >+ sedscript=$tmpdir/psset.sed >+ >+ # The version/usage strings >+@@ -186,8 +186,6 @@ case $# in >+ exit 1;; >+ esac >+ >+-mkdir $tmpdir >+- >+ if test -n "$debug"; then >+ # Set -x now if debugging >+ set -x >Index: files/patch-contrib_texi2dvi4a2ps >=================================================================== >--- files/patch-contrib_texi2dvi4a2ps (revision 0) >+++ files/patch-contrib_texi2dvi4a2ps (working copy) >@@ -0,0 +1,21 @@ >+--- contrib/texi2dvi4a2ps.orig 2000-02-24 17:45:31 UTC >++++ contrib/texi2dvi4a2ps >+@@ -91,7 +91,7 @@ oname= # --output >+ quiet= # by default let the tools' message be displayed >+ set_language= >+ textra= >+-tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems. >++tmpdir=$(mktemp -d -t ${program}) || exit 1 >+ txincludes= # TEXINPUTS extensions >+ txiprereq=19990129 # minimum texinfo.tex version to have macro expansion >+ verbose=false # echo for verbose mode >+@@ -203,9 +203,6 @@ if test -z "$debug"; then >+ trap "cd / && rm -rf $tmpdir" 0 1 2 15 >+ fi >+ >+-# Create the temporary directory with strict rights >+-(umask 077 && mkdir $tmpdir) || exit 1 >+- >+ # Prepare the tools we might need. This may be extra work in some >+ # cases, but improves the readibility of the script. >+ utildir=$tmpdir/utils >Index: files/patch-etc-Makefile.in >=================================================================== >--- files/patch-etc-Makefile.in (revision 386312) >+++ files/patch-etc-Makefile.in (working copy) >@@ -1,6 +1,6 @@ >---- etc/Makefile.in.orig Tue Nov 20 19:09:45 2001 >-+++ etc/Makefile.in Tue Nov 20 19:09:53 2001 >-@@ -131,7 +131,7 @@ >+--- etc/Makefile.in.orig 2000-02-24 17:55:34 UTC >++++ etc/Makefile.in >+@@ -131,7 +131,7 @@ l = @l@ > lispdir = @lispdir@ > > >Index: files/patch-intl_localealias.c >=================================================================== >--- files/patch-intl_localealias.c (revision 0) >+++ files/patch-intl_localealias.c (working copy) >@@ -0,0 +1,20 @@ >+--- intl/localealias.c.orig 1999-08-31 17:29:35 UTC >++++ intl/localealias.c >+@@ -329,6 +329,17 @@ read_alias_file (fname, fname_len) >+ FREE_BLOCKS (block_list); >+ return added; >+ } >++ if (string_space != new_pool) >++ { >++ size_t i; >++ >++ for (i = 0; i < nmap; i++) >++ { >++ map[i].alias += new_pool - string_space; >++ map[i].value += new_pool - string_space; >++ } >++ } >++ >+ string_space = new_pool; >+ string_space_max = new_size; >+ } >Index: files/patch-lib_options.c >=================================================================== >--- files/patch-lib_options.c (revision 0) >+++ files/patch-lib_options.c (working copy) >@@ -0,0 +1,18 @@ >+--- lib/options.c.orig 1999-08-31 17:42:41 UTC >++++ lib/options.c >+@@ -493,6 +493,15 @@ a2ps_handle_options (a2ps_job * job, int >+ /* A font size is given */ >+ job->fontsize = get_length ("--font-size", cp, >+ 0.0, 0.0, "pt", range_min_strict); >++ if (job->fontsize == 0.0) >++ { >++ error (0, 0, _("invalid argument %s for -f or --font-size option"), >++ cp); >++ fprintf (stderr, >++ _("Valid arguments are floats with optonal units!\n")); >++ fprintf (stderr, _("Try `a2ps --help' for more information.\n")); >++ exit (EXIT_FAILURE); >++ } >+ job->columns_requested = 0; >+ job->lines_requested = 0; >+ } >Index: files/patch-lib_printers.c >=================================================================== >--- files/patch-lib_printers.c (revision 0) >+++ files/patch-lib_printers.c (working copy) >@@ -0,0 +1,13 @@ >+--- lib/printers.c.orig 1999-10-11 22:01:59 UTC >++++ lib/printers.c >+@@ -315,8 +315,8 @@ a2ps_printers_new (struct a2ps_common_s >+ res->ppd = NULL; /* Printer's ppd are not read yet */ >+ >+ /* Output */ >+- /* Default is to send to default printer */ >+- res->flag_output_is_printer = true; >++ /* Default is to send to stdout */ >++ res->flag_output_is_printer = false; >+ res->flag_output_name = NULL; >+ res->output_is_file = true; >+ res->output_name = NULL; >Index: files/patch-lib_printlen.c >=================================================================== >--- files/patch-lib_printlen.c (revision 0) >+++ files/patch-lib_printlen.c (working copy) >@@ -0,0 +1,27 @@ >+--- lib/printlen.c.orig 1999-08-31 17:42:42 UTC >++++ lib/printlen.c >+@@ -28,14 +28,11 @@ Foundation, Inc., 59 Temple Place - Suit >+ unsigned long strtoul (); >+ >+ static int >+-int_printflen (const char *format, va_list *args) >++int_printflen (const char *format, va_list ap) >+ { >+ const char *cp; >+ int total_width = 0; >+ int width = 0; >+- va_list ap; >+- >+- memcpy (&ap, args, sizeof (va_list)); >+ >+ for (cp = format ; *cp ; cp++) >+ { >+@@ -99,7 +96,7 @@ int_printflen (const char *format, va_li >+ int >+ vprintflen (const char *format, va_list args) >+ { >+- return int_printflen (format, &args); >++ return int_printflen (format, args); >+ } >+ >+ int >Index: files/patch-lib_title.c >=================================================================== >--- files/patch-lib_title.c (revision 0) >+++ files/patch-lib_title.c (working copy) >@@ -0,0 +1,11 @@ >+--- lib/title.c.orig 2015-09-25 08:26:23 UTC >++++ lib/title.c >+@@ -88,6 +88,8 @@ title (stream, c, center_p, format, va_a >+ if (center_p) >+ for (padding = 0 ; padding < 79 - len ; padding += 2) >+ putc (' ', stream); >++ va_end(args); >++ VA_START(args, format); >+ # if HAVE_VPRINTF || _LIBC >+ vfprintf (stream, format, args); >+ # else >Index: files/patch-lib_xgethostname.c >=================================================================== >--- files/patch-lib_xgethostname.c (revision 0) >+++ files/patch-lib_xgethostname.c (working copy) >@@ -0,0 +1,28 @@ >+--- lib/xgethostname.c.orig 1999-08-28 17:11:35 UTC >++++ lib/xgethostname.c >+@@ -21,6 +21,7 @@ >+ # include <config.h> >+ #endif >+ >++#include <sys/param.h> >+ #include <sys/types.h> >+ >+ #include <errno.h> >+@@ -38,7 +39,7 @@ extern int errno; >+ int gethostname (); >+ >+ #ifndef INITIAL_HOSTNAME_LENGTH >+-# define INITIAL_HOSTNAME_LENGTH 34 >++# define INITIAL_HOSTNAME_LENGTH MAXHOSTNAMELEN >+ #endif >+ >+ char * >+@@ -63,7 +64,7 @@ xgethostname () >+ if (err == 0 && hostname[k] == '\0') >+ break; >+ #ifdef ENAMETOOLONG >+- else if (err != 0 && errno != ENAMETOOLONG && errno != 0) >++ else if (err != 0 && errno != ENAMETOOLONG && errno != ENOMEM && errno != 0) >+ error (EXIT_FAILURE, errno, "gethostname"); >+ #endif >+ size *= 2; >Index: files/patch-localealias.c >=================================================================== >--- files/patch-localealias.c (revision 386312) >+++ files/patch-localealias.c (working copy) >@@ -1,20 +0,0 @@ >---- intl/localealias.c.orig Tue Aug 31 13:29:35 1999 >-+++ intl/localealias.c Tue Aug 12 11:09:53 2003 >-@@ -329,6 +329,17 @@ >- FREE_BLOCKS (block_list); >- return added; >- } >-+ if (string_space != new_pool) >-+ { >-+ size_t i; >-+ >-+ for (i = 0; i < nmap; i++) >-+ { >-+ map[i].alias += new_pool - string_space; >-+ map[i].value += new_pool - string_space; >-+ } >-+ } >-+ >- string_space = new_pool; >- string_space_max = new_size; >- } >Index: files/patch-ogonkify-Makefile.in >=================================================================== >--- files/patch-ogonkify-Makefile.in (revision 386312) >+++ files/patch-ogonkify-Makefile.in (working copy) >@@ -1,6 +1,6 @@ >---- ogonkify/Makefile.in.orig Tue Apr 20 00:07:03 1999 >-+++ ogonkify/Makefile.in Tue Apr 20 00:07:07 1999 >-@@ -37,7 +37,7 @@ >+--- ogonkify/Makefile.in.orig 2000-01-07 13:00:49 UTC >++++ ogonkify/Makefile.in >+@@ -33,7 +33,7 @@ oldincludedir = /usr/include > > DESTDIR = > >Index: files/patch-options.c >=================================================================== >--- files/patch-options.c (revision 386312) >+++ files/patch-options.c (working copy) >@@ -1,18 +0,0 @@ >---- lib/options.c.orig Thu Sep 21 23:22:36 2000 >-+++ lib/options.c Thu Sep 21 23:22:42 2000 >-@@ -493,6 +493,15 @@ >- /* A font size is given */ >- job->fontsize = get_length ("--font-size", cp, >- 0.0, 0.0, "pt", range_min_strict); >-+ if (job->fontsize == 0.0) >-+ { >-+ error (0, 0, _("invalid argument %s for -f or --font-size option"), >-+ cp); >-+ fprintf (stderr, >-+ _("Valid arguments are floats with optonal units!\n")); >-+ fprintf (stderr, _("Try `a2ps --help' for more information.\n")); >-+ exit (EXIT_FAILURE); >-+ } >- job->columns_requested = 0; >- job->lines_requested = 0; >- } >Index: files/patch-printers.c >=================================================================== >--- files/patch-printers.c (revision 386312) >+++ files/patch-printers.c (working copy) >@@ -1,13 +0,0 @@ >---- lib/printers.c.orig Tue Oct 12 00:01:59 1999 >-+++ lib/printers.c Wed May 2 11:23:25 2001 >-@@ -315,8 +315,8 @@ >- res->ppd = NULL; /* Printer's ppd are not read yet */ >- >- /* Output */ >-- /* Default is to send to default printer */ >-- res->flag_output_is_printer = true; >-+ /* Default is to send to stdout */ >-+ res->flag_output_is_printer = false; >- res->flag_output_name = NULL; >- res->output_is_file = true; >- res->output_name = NULL; >Index: files/patch-select.c >=================================================================== >--- files/patch-select.c (revision 386312) >+++ files/patch-select.c (working copy) >@@ -1,57 +0,0 @@ >---- src/select.c.orig Thu Dec 16 02:04:56 1999 >-+++ src/select.c Sat Aug 21 12:05:31 2004 >-@@ -131,6 +131,36 @@ >- return 1; >- } >- >-+/* escapes the name of a file so that the shell groks it in 'single' q.marks. >-+ The resulting pointer has to be free()ed when not longer used. */ >-+char * >-+shell_escape(const char *fn) >-+{ >-+ size_t len = 0; >-+ const char *inp; >-+ char *retval, *outp; >-+ >-+ for(inp = fn; *inp; ++inp) >-+ switch(*inp) >-+ { >-+ case '\'': len += 4; break; >-+ default: len += 1; break; >-+ } >-+ >-+ outp = retval = malloc(len + 1); >-+ if(!outp) >-+ return NULL; /* perhaps one should do better error handling here */ >-+ for(inp = fn; *inp; ++inp) >-+ switch(*inp) >-+ { >-+ case '\'': *outp++ = '\''; *outp++ = '\\'; *outp++ = '\'', *outp++ = '\''; break; >-+ default: *outp++ = *inp; break; >-+ } >-+ *outp = 0; >-+ >-+ return retval; >-+} >-+ >- /* What says file about the type of a file (result is malloc'd). NULL >- if could not be run. */ >- >-@@ -144,11 +174,15 @@ >- if (IS_EMPTY (job->file_command)) >- return NULL; >- >-+ filename = shell_escape(filename); >-+ if(filename == NULL) >-+ return NULL; >- /* Call file(1) with the correct option */ >-- command = ALLOCA (char, (2 >-+ command = ALLOCA (char, (4 >- + strlen (job->file_command) >- + ustrlen (filename))); >-- sprintf (command, "%s %s", job->file_command, (const char *) filename); >-+ sprintf (command, "%s '%s'", job->file_command, (const char *) filename); >-+ free(filename); >- message (msg_tool, (stderr, "Reading pipe: `%s'\n", command)); >- file_out = popen (command, "r"); >- >Index: files/patch-src_select.c >=================================================================== >--- files/patch-src_select.c (revision 0) >+++ files/patch-src_select.c (working copy) >@@ -0,0 +1,57 @@ >+--- src/select.c.orig 1999-12-16 01:04:56 UTC >++++ src/select.c >+@@ -131,6 +131,36 @@ sheets_map_load_main (void) >+ return 1; >+ } >+ >++/* escapes the name of a file so that the shell groks it in 'single' q.marks. >++ The resulting pointer has to be free()ed when not longer used. */ >++char * >++shell_escape(const char *fn) >++{ >++ size_t len = 0; >++ const char *inp; >++ char *retval, *outp; >++ >++ for(inp = fn; *inp; ++inp) >++ switch(*inp) >++ { >++ case '\'': len += 4; break; >++ default: len += 1; break; >++ } >++ >++ outp = retval = malloc(len + 1); >++ if(!outp) >++ return NULL; /* perhaps one should do better error handling here */ >++ for(inp = fn; *inp; ++inp) >++ switch(*inp) >++ { >++ case '\'': *outp++ = '\''; *outp++ = '\\'; *outp++ = '\'', *outp++ = '\''; break; >++ default: *outp++ = *inp; break; >++ } >++ *outp = 0; >++ >++ return retval; >++} >++ >+ /* What says file about the type of a file (result is malloc'd). NULL >+ if could not be run. */ >+ >+@@ -144,11 +174,15 @@ file_verdict_on (const uchar *filename) >+ if (IS_EMPTY (job->file_command)) >+ return NULL; >+ >++ filename = shell_escape(filename); >++ if(filename == NULL) >++ return NULL; >+ /* Call file(1) with the correct option */ >+- command = ALLOCA (char, (2 >++ command = ALLOCA (char, (4 >+ + strlen (job->file_command) >+ + ustrlen (filename))); >+- sprintf (command, "%s %s", job->file_command, (const char *) filename); >++ sprintf (command, "%s '%s'", job->file_command, (const char *) filename); >++ free(filename); >+ message (msg_tool, (stderr, "Reading pipe: `%s'\n", command)); >+ file_out = popen (command, "r"); >+ >Index: files/patch-xgethostname.c >=================================================================== >--- files/patch-xgethostname.c (revision 386312) >+++ files/patch-xgethostname.c (working copy) >@@ -1,28 +0,0 @@ >---- lib/xgethostname.c.orig Tue Sep 4 00:51:26 2001 >-+++ lib/xgethostname.c Tue Sep 4 00:55:39 2001 >-@@ -21,6 +21,7 @@ >- # include <config.h> >- #endif >- >-+#include <sys/param.h> >- #include <sys/types.h> >- >- #include <errno.h> >-@@ -38,7 +39,7 @@ >- int gethostname (); >- >- #ifndef INITIAL_HOSTNAME_LENGTH >--# define INITIAL_HOSTNAME_LENGTH 34 >-+# define INITIAL_HOSTNAME_LENGTH MAXHOSTNAMELEN >- #endif >- >- char * >-@@ -63,7 +64,7 @@ >- if (err == 0 && hostname[k] == '\0') >- break; >- #ifdef ENAMETOOLONG >-- else if (err != 0 && errno != ENAMETOOLONG && errno != 0) >-+ else if (err != 0 && errno != ENAMETOOLONG && errno != ENOMEM && errno != 0) >- error (EXIT_FAILURE, errno, "gethostname"); >- #endif >- size *= 2;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203326
: 161371 |
161451