$NetBSD: patch-aa,v 1.2 2005/03/17 12:24:13 salo Exp $ --- src/main.c.orig 2002-01-24 08:35:45.000000000 +0100 +++ src/main.c 2005-03-17 11:52:58.000000000 +0100 @@ -1546,9 +1546,13 @@ buffer_append (&cmd, intbuf); buffer_append (&cmd, " "); - buffer_append (&cmd, "-Ddocument_title=\""); - buffer_append (&cmd, title); - buffer_append (&cmd, "\" "); + buffer_append (&cmd, "-Ddocument_title=\'"); + if ((cp = shell_escape (title)) != NULL) + { + buffer_append (&cmd, cp); + free (cp); + } + buffer_append (&cmd, "\' "); buffer_append (&cmd, "-Dtoc="); buffer_append (&cmd, toc ? "1" : "0"); @@ -1565,8 +1569,14 @@ /* Append input files. */ for (i = optind; i < argc; i++) { - buffer_append (&cmd, " "); - buffer_append (&cmd, argv[i]); + char *cp; + if ((cp = shell_escape (argv[i])) != NULL) + { + buffer_append (&cmd, " \'"); + buffer_append (&cmd, cp); + buffer_append (&cmd, "\'"); + free (cp); + } } /* And do the job. */ @@ -1627,7 +1637,7 @@ buffer_ptr (opts), buffer_len (opts)); } - buffer_append (&buffer, " \"%s\""); + buffer_append (&buffer, " \'%s\'"); input_filter = buffer_copy (&buffer); input_filter_stdin = "-";